mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
bugfix
This commit is contained in:
@@ -151,11 +151,18 @@ public class AuthFilter extends OncePerRequestFilter {
|
||||
if (BooleanUtils.isTrue(user.getSysAdmin())) {
|
||||
hasPermission = true;
|
||||
} else if (BooleanUtils.isTrue(user.getOrgAdmin())) {
|
||||
// 机构管理员
|
||||
|
||||
hasPermission = permissionService.orgAdminHasPermission(resource.get().getId());
|
||||
} else {
|
||||
// 普通用户默认权限
|
||||
hasPermission = permissionService.orgUserHasPermission(resource.get().getId());
|
||||
|
||||
hasPermission = userService.hasResource(user.getId(), resource.get().getId());
|
||||
if (!hasPermission) {
|
||||
|
||||
// 普通用户指定权限
|
||||
hasPermission = userService.hasResource(user.getId(), resource.get().getId());
|
||||
}
|
||||
}
|
||||
|
||||
stopWatch.stop();
|
||||
|
||||
@@ -253,4 +253,8 @@ public class PermissionService extends BaseService<PermissionEntity, PermissionR
|
||||
|
||||
|
||||
}
|
||||
|
||||
public boolean orgUserHasPermission(String resourceId) {
|
||||
return this.repository.hasPermission(resourceId, Arrays.asList("0", "1"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user