mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-08 00:49:21 +08:00
修复权限判断错误
This commit is contained in:
@@ -107,7 +107,7 @@ public interface Authentication extends Serializable {
|
||||
* @return 是否持有权限
|
||||
*/
|
||||
default boolean hasPermission(String permissionId, String... actions) {
|
||||
return !getPermission(permissionId)
|
||||
return getPermission(permissionId)
|
||||
.filter(permission -> actions.length == 0 || permission.getActions().containsAll(Arrays.asList(actions)))
|
||||
.isPresent();
|
||||
}
|
||||
@@ -117,7 +117,7 @@ public interface Authentication extends Serializable {
|
||||
* @return 是否拥有某个角色
|
||||
*/
|
||||
default boolean hasRole(String roleId) {
|
||||
return !getRole(roleId).isPresent();
|
||||
return getRole(roleId).isPresent();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user