This commit is contained in:
@@ -1188,6 +1188,12 @@ public class GroupAuthzService implements IGroupAuthzService {
|
||||
public boolean hasModulePermission(Integer userId, Integer moduleId) {
|
||||
Objects.requireNonNull(userId, "用户ID不能为空");
|
||||
Objects.requireNonNull(moduleId, "模块ID不能为空");
|
||||
// 超级管理员(UserTypeEnum.SUPER_ADMIN / 基石账号):直接赋予全部模块权限,
|
||||
// 不做任何组/角色/继承判定——避免「超管不归属任何组 → userRels 为空 → 直接返回 false(即无任何权限)」的 bug。
|
||||
SysUser user = sysUserRepository.findById(userId).orElse(null);
|
||||
if (user != null && isSuperAdmin(user.getType(), userId)) {
|
||||
return true;
|
||||
}
|
||||
AppModule module = appModuleRepository.findById(moduleId).orElse(null);
|
||||
if (module == null) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user