Skip to content

Commit

Permalink
修改权限字符匹配方式
Browse files Browse the repository at this point in the history
  • Loading branch information
yangzongzhuan committed Nov 10, 2023
1 parent d4cc75b commit cf5b0b9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/com/ruoyi/common/utils/SecurityUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
*/
public class SecurityUtils
{

/**
* 用户ID
**/
Expand Down Expand Up @@ -146,7 +145,7 @@ public static boolean hasPermi(String permission)
public static boolean hasPermi(Collection<String> authorities, String permission)
{
return authorities.stream().filter(StringUtils::hasText)
.anyMatch(x -> Constants.ALL_PERMISSION.contains(x) || PatternMatchUtils.simpleMatch(x, permission));
.anyMatch(x -> Constants.ALL_PERMISSION.equals(x) || PatternMatchUtils.simpleMatch(x, permission));
}

/**
Expand All @@ -172,6 +171,6 @@ public static boolean hasRole(String role)
public static boolean hasRole(Collection<String> roles, String role)
{
return roles.stream().filter(StringUtils::hasText)
.anyMatch(x -> Constants.SUPER_ADMIN.contains(x) || PatternMatchUtils.simpleMatch(x, role));
.anyMatch(x -> Constants.SUPER_ADMIN.equals(x) || PatternMatchUtils.simpleMatch(x, role));
}
}

0 comments on commit cf5b0b9

Please sign in to comment.