Class AccessPermission

java.lang.Object
ch.tocco.nice2.persist.security.api.AccessPermission
All Implemented Interfaces:
Permission, Serializable

public final class AccessPermission extends Object implements Permission
See Also:
  • Constructor Details

    • AccessPermission

      public AccessPermission()
    • AccessPermission

      public AccessPermission(@Nullable @Nullable AccessPermission.Access[] access)
  • Method Details

    • read

      public static AccessPermission read()
    • write

      public static AccessPermission write()
    • readWrite

      public static AccessPermission readWrite()
    • toString

      public String toString()
      Specified by:
      toString in interface Permission
      Overrides:
      toString in class Object
    • getName

      public String getName()
      Specified by:
      getName in interface Permission
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Permission
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • implies

      public boolean implies(Permission permission)
      Description copied from interface: Permission
      Check whether this permission implies another permission. Be careful when implementing this method on your own permissions because this is basically the core of the whole security concept.

      A permission implies another permission, if the other permission is a subset of this permission. For example, the permission to access all fields of an entity implies the permission to access the specific field "myField" of the same entity, or the permission to access all files under /my/directory implies the permission to access the file /my/directory/myFile.

      Specified by:
      implies in interface Permission
      Parameters:
      permission - The permission to check.
      Returns:
      true, if this permission implies the given permission, false otherwise.
    • isWritable

      public boolean isWritable()
    • isReadable

      public boolean isReadable()