Class SecurityPermissions


  • public class SecurityPermissions
    extends java.lang.Object
    Author:
    javaito.
    • Method Summary

      Modifier and Type Method Description
      static void checkPermission​(java.lang.Class targetClass, java.lang.String permissionName)
      Checks if the current identity contains the grants for the specific permission.
      static void checkPermission​(java.lang.Class targetClass, java.lang.String permissionName, SecurityPermissions.GrantedAction action)
      Checks if the current identity contains the grants for the specific permission, if the permission is granted then is executed the attached action.
      static SecurityPermissions.SecurityPermission publishPermission​(java.lang.Class targetClass, java.lang.String permissionName, java.lang.String description, java.util.List<java.lang.String> tags)
      Publish a new permission.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SecurityPermissions

        public SecurityPermissions()
    • Method Detail

      • publishPermission

        public static SecurityPermissions.SecurityPermission publishPermission​(java.lang.Class targetClass,
                                                                               java.lang.String permissionName,
                                                                               java.lang.String description,
                                                                               java.util.List<java.lang.String> tags)
        Publish a new permission.
        Parameters:
        targetClass - Class that publish the permission.
        permissionName - Name of the permission.
        Returns:
        Returns the instance of the new permission created.
      • checkPermission

        public static void checkPermission​(java.lang.Class targetClass,
                                           java.lang.String permissionName)
        Checks if the current identity contains the grants for the specific permission.
        Parameters:
        targetClass - Class that publish the permission.
        permissionName - Name of the permission.
      • checkPermission

        public static void checkPermission​(java.lang.Class targetClass,
                                           java.lang.String permissionName,
                                           SecurityPermissions.GrantedAction action)
        Checks if the current identity contains the grants for the specific permission, if the permission is granted then is executed the attached action.
        Parameters:
        targetClass - Class that publish the permission.
        permissionName - Name of the permission.
        action - Action to execute if the permission is granted.