This commit is contained in:
heavyrain.lee
2019-05-25 07:55:30 +08:00
parent fbd1a7f5dc
commit 331c38cc98
5 changed files with 10 additions and 8 deletions
@@ -749,7 +749,7 @@ public class MemoryMessagesStore implements IMessagesStore {
}
@Override
public ErrorCode dismissGroup(String operator, String groupId) {
public ErrorCode dismissGroup(String operator, String groupId, boolean isAdmin) {
HazelcastInstance hzInstance = m_Server.getHazelcastInstance();
IMap<String, WFCMessage.GroupInfo> mIMap = hzInstance.getMap(GROUPS_MAP);
@@ -762,9 +762,9 @@ public class MemoryMessagesStore implements IMessagesStore {
return ErrorCode.ERROR_CODE_NOT_EXIST;
}
if (groupInfo.getType() == ProtoConstants.GroupType.GroupType_Free ||
if (!isAdmin && (groupInfo.getType() == ProtoConstants.GroupType.GroupType_Free ||
(groupInfo.getType() == ProtoConstants.GroupType.GroupType_Restricted || groupInfo.getType() == ProtoConstants.GroupType.GroupType_Normal)
&& (groupInfo.getOwner() == null || !groupInfo.getOwner().equals(operator))) {
&& (groupInfo.getOwner() == null || !groupInfo.getOwner().equals(operator)))) {
return ErrorCode.ERROR_CODE_NOT_RIGHT;
}