Class SecurityExpressionUtils
- java.lang.Object
-
- org.seedstack.seed.security.internal.securityexpr.SecurityExpressionUtils
-
public final class SecurityExpressionUtils extends Object
This class is an entry point for the security expression language.It is mainly a static gateway to
SecuritySupport.It is not meant to be used by projects directly.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanhasPermission(String permission)Checks the current user permission.static booleanhasPermissionOn(String permission, String simpleScope)Checks the current user permission.static booleanhasRole(String role)Checks the current user role.static booleanhasRoleOn(String role, String simpleScope)Checks the current user role in the given scopes.
-
-
-
Method Detail
-
hasRole
public static boolean hasRole(String role)
Checks the current user role.- Parameters:
role- the role to check- Returns:
- true if user has the given role
-
hasRoleOn
public static boolean hasRoleOn(String role, String simpleScope)
Checks the current user role in the given scopes.- Parameters:
role- the role to checksimpleScope- the simple scope to check this role on.- Returns:
- true if the user has the role for the given simple scope.
-
hasPermission
public static boolean hasPermission(String permission)
Checks the current user permission.- Parameters:
permission- the permission to check- Returns:
- true if user has the given permission
-
hasPermissionOn
public static boolean hasPermissionOn(String permission, String simpleScope)
Checks the current user permission.- Parameters:
permission- the permission to checksimpleScope- the simple scope to check this permission on.- Returns:
- true if user has the given permission for the given simple scope.
-
-