From a7f457a5f2ef1e0e403ed06f70ac93e5c822ede2 Mon Sep 17 00:00:00 2001 From: zhou-hao Date: Tue, 28 Nov 2017 15:33:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9D=83=E9=99=90=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/hswebframework/web/authorization/Authentication.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/Authentication.java b/hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/Authentication.java index 1cc28f089..f6acbd7b0 100644 --- a/hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/Authentication.java +++ b/hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/Authentication.java @@ -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(); } /**