Class StringPermission

java.lang.Object
java.security.Permission
io.quarkus.security.StringPermission
All Implemented Interfaces:
Serializable, Guard

public final class StringPermission extends Permission
Represents permission based on simple string comparison.
See Also:
  • Field Details

  • Constructor Details

    • StringPermission

      public StringPermission(String permissionName, String... actions)
      Constructs a permission with the specified name and actions.
      Parameters:
      permissionName - must not be null or empty and must not contain comma
      actions - optional actions; action itself must not be null or empty and must not contain comma
  • Method Details

    • implies

      public boolean implies(Permission p)
      Checks if this StringPermission object "implies" the specified permission.

      More precisely, this method returns true if:

      • p is an instance of the StringPermission
      • p's name equals this object's name
      • compared permissions have no actions, or this object's actions contains at least one of the p actions
      Specified by:
      implies in class Permission
      Parameters:
      p - the permission to check against
      Returns:
      true if the specified permission is implied by this object
    • equals

      public boolean equals(Object p)
      Specified by:
      equals in class Permission
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class Permission
    • getActions

      public String getActions()
      Specified by:
      getActions in class Permission
      Returns:
      null if no actions were specified, or actions joined together with the ACTIONS_SEPARATOR