allow admin to by pass clerk list filtering
Some checks failed
Build and Push Backend / docker (push) Failing after 5s
Some checks failed
Build and Push Backend / docker (push) Failing after 5s
This commit is contained in:
@@ -135,7 +135,7 @@ public class PlayPersonnelGroupInfoServiceImpl
|
||||
List<String> idList;
|
||||
Set<String> roleKeys = loginUser != null && loginUser.getRoles() != null ? loginUser.getRoles()
|
||||
: Collections.emptySet();
|
||||
boolean hasOperatorRole = TenantRoleEnum.contains(roleKeys, TenantRoleEnum.OPERATOR);
|
||||
boolean hasOperatorRole = TenantRoleEnum.hasOperatorPrivilege(roleKeys);
|
||||
PlayPersonnelGroupInfoEntity groupInfoEntity = null;
|
||||
if (!hasOperatorRole && loginUser != null) {
|
||||
groupInfoEntity = this.selectByUserId(loginUser.getUserId());
|
||||
|
||||
@@ -14,6 +14,11 @@ public enum TenantRoleEnum {
|
||||
*/
|
||||
OPERATOR("operator"),
|
||||
|
||||
/**
|
||||
* 超级管理员角色,与运营角色享有同等权限。
|
||||
*/
|
||||
ADMIN("admin"),
|
||||
|
||||
/**
|
||||
* 组长角色,只能查看所在小组的数据。
|
||||
*/
|
||||
@@ -50,4 +55,11 @@ public enum TenantRoleEnum {
|
||||
.map(role -> role.toLowerCase(Locale.ROOT))
|
||||
.anyMatch(role -> role.equals(targetRole.getRoleKey()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否具备运营权限(operator/admin)。
|
||||
*/
|
||||
public static boolean hasOperatorPrivilege(Set<String> roles) {
|
||||
return contains(roles, OPERATOR) || contains(roles, ADMIN);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user