This commit is contained in:
heavyrain.lee
2019-05-24 21:08:31 +08:00
parent 3e1efe4c4c
commit fbd1a7f5dc
14 changed files with 313 additions and 7 deletions
@@ -913,7 +913,7 @@ public class MemoryMessagesStore implements IMessagesStore {
@Override
public ErrorCode transferGroup(String operator, String groupId, String newOwner) {
public ErrorCode transferGroup(String operator, String groupId, String newOwner, boolean isAdmin) {
HazelcastInstance hzInstance = m_Server.getHazelcastInstance();
IMap<String, WFCMessage.GroupInfo> mIMap = hzInstance.getMap(GROUPS_MAP);
@@ -924,7 +924,7 @@ public class MemoryMessagesStore implements IMessagesStore {
return ErrorCode.ERROR_CODE_NOT_EXIST;
}
if ((groupInfo.getType() == ProtoConstants.GroupType.GroupType_Restricted || groupInfo.getType() == ProtoConstants.GroupType.GroupType_Normal)
if (!isAdmin && (groupInfo.getType() == ProtoConstants.GroupType.GroupType_Restricted || groupInfo.getType() == ProtoConstants.GroupType.GroupType_Normal)
&& (groupInfo.getOwner() == null || !groupInfo.getOwner().equals(operator))) {
return ErrorCode.ERROR_CODE_NOT_RIGHT;
}