refactor(用户组与权限): 移除用户组成员校验
This commit is contained in:
parent
2cbcb79f14
commit
3ec78ee523
|
@ -463,6 +463,15 @@ public class GroupService {
|
|||
}
|
||||
|
||||
public void removeGroupMember(String userId, String groupId) {
|
||||
Group group = groupMapper.selectByPrimaryKey(groupId);
|
||||
if (group == null) {
|
||||
MSException.throwException("group does not exist!");
|
||||
return;
|
||||
}
|
||||
if (!StringUtils.equals(group.getType(), UserGroupType.PROJECT)) {
|
||||
MSException.throwException("no permission to remove non-project type group users!");
|
||||
return;
|
||||
}
|
||||
UserGroupExample userGroupExample = new UserGroupExample();
|
||||
userGroupExample.createCriteria()
|
||||
.andGroupIdEqualTo(groupId)
|
||||
|
|
|
@ -126,6 +126,7 @@ public class GroupController {
|
|||
}
|
||||
|
||||
@GetMapping("/rm/{userId}/{groupId}")
|
||||
@RequiresPermissions(PermissionConstants.SYSTEM_GROUP_READ)
|
||||
public void removeGroupMember(@PathVariable String userId, @PathVariable String groupId) {
|
||||
groupService.removeGroupMember(userId, groupId);
|
||||
}
|
||||
|
|
|
@ -162,10 +162,11 @@ public class GroupService {
|
|||
|
||||
public void deleteGroup(String id) {
|
||||
Group group = groupMapper.selectByPrimaryKey(id);
|
||||
if (group != null) {
|
||||
if (BooleanUtils.isTrue(group.getSystem())) {
|
||||
MSException.throwException("系统用户组不支持删除!");
|
||||
}
|
||||
if (group == null) {
|
||||
MSException.throwException("group does not exist!");
|
||||
}
|
||||
if (BooleanUtils.isTrue(group.getSystem())) {
|
||||
MSException.throwException("系统用户组不支持删除!");
|
||||
}
|
||||
groupMapper.deleteByPrimaryKey(id);
|
||||
|
||||
|
|
Loading…
Reference in New Issue