Class 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 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 check
        simpleScope - 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 check
        simpleScope - the simple scope to check this permission on.
        Returns:
        true if user has the given permission for the given simple scope.