diff options
author | Justin Clark-Casey (justincc) | 2014-07-31 21:32:20 +0100 |
---|---|---|
committer | Justin Clark-Casey | 2014-08-02 00:58:37 +0100 |
commit | 319bbce5176b5ba667bfc720f4cfd963ee937455 (patch) | |
tree | e074c7a672c735b6467d9cac19d91772cbcf497b /OpenSim/Addons/Groups/Service/HGGroupsService.cs | |
parent | Don't overwrite the null result with the true result is groups service REMOVE... (diff) | |
download | opensim-SC_OLD-319bbce5176b5ba667bfc720f4cfd963ee937455.zip opensim-SC_OLD-319bbce5176b5ba667bfc720f4cfd963ee937455.tar.gz opensim-SC_OLD-319bbce5176b5ba667bfc720f4cfd963ee937455.tar.bz2 opensim-SC_OLD-319bbce5176b5ba667bfc720f4cfd963ee937455.tar.xz |
If REMOVEAGENTFROMGROUP core groups call fails because requesting agent does not have sufficient permission, return null failure result rather than true.
On non-HG this is on the only recognized failure state so we can return more information in the error result.
On HG there are multiple failure states which would require more work to distinguish, so currently return the unsatisfying "Internal Error" like some other existing calls.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Addons/Groups/Service/HGGroupsService.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/OpenSim/Addons/Groups/Service/HGGroupsService.cs b/OpenSim/Addons/Groups/Service/HGGroupsService.cs index 9d7961c..56e999b 100644 --- a/OpenSim/Addons/Groups/Service/HGGroupsService.cs +++ b/OpenSim/Addons/Groups/Service/HGGroupsService.cs | |||
@@ -131,19 +131,27 @@ namespace OpenSim.Groups | |||
131 | return true; | 131 | return true; |
132 | } | 132 | } |
133 | 133 | ||
134 | public void RemoveAgentFromGroup(string RequestingAgentID, string AgentID, UUID GroupID, string token) | 134 | public bool RemoveAgentFromGroup(string RequestingAgentID, string AgentID, UUID GroupID, string token) |
135 | { | 135 | { |
136 | // check the token | 136 | // check the token |
137 | MembershipData membership = m_Database.RetrieveMember(GroupID, AgentID); | 137 | MembershipData membership = m_Database.RetrieveMember(GroupID, AgentID); |
138 | if (membership != null) | 138 | if (membership != null) |
139 | { | 139 | { |
140 | if (token != string.Empty && token.Equals(membership.Data["AccessToken"])) | 140 | if (token != string.Empty && token.Equals(membership.Data["AccessToken"])) |
141 | RemoveAgentFromGroup(RequestingAgentID, AgentID, GroupID); | 141 | { |
142 | return RemoveAgentFromGroup(RequestingAgentID, AgentID, GroupID); | ||
143 | } | ||
142 | else | 144 | else |
145 | { | ||
143 | m_log.DebugFormat("[Groups.HGGroupsService]: access token {0} did not match stored one {1}", token, membership.Data["AccessToken"]); | 146 | m_log.DebugFormat("[Groups.HGGroupsService]: access token {0} did not match stored one {1}", token, membership.Data["AccessToken"]); |
147 | return false; | ||
148 | } | ||
144 | } | 149 | } |
145 | else | 150 | else |
151 | { | ||
146 | m_log.DebugFormat("[Groups.HGGroupsService]: membership not found for {0}", AgentID); | 152 | m_log.DebugFormat("[Groups.HGGroupsService]: membership not found for {0}", AgentID); |
153 | return false; | ||
154 | } | ||
147 | } | 155 | } |
148 | 156 | ||
149 | public ExtendedGroupRecord GetGroupRecord(string RequestingAgentID, UUID GroupID, string groupName, string token) | 157 | public ExtendedGroupRecord GetGroupRecord(string RequestingAgentID, UUID GroupID, string groupName, string token) |