Class ACE

java.lang.Object
org.nuxeo.ecm.core.api.security.ACE
All Implemented Interfaces:
Serializable, Cloneable

public final class ACE extends Object implements Serializable, Cloneable
Access control entry, assigning a permission to a user.

Optionally, the assignment can be denied instead of being granted.

See Also:
  • Field Details

    • BLOCK

      public static final ACE BLOCK
      An ACE that blocks all permissions for everyone.
      Since:
      6.0
    • ID_PATTERN

      protected static final Pattern ID_PATTERN
  • Constructor Details

    • ACE

      public ACE()
    • ACE

      public ACE(String username, String permission, boolean isGranted)
      Constructs an ACE for a given username and permission, and specifies whether to grant or deny it.
    • ACE

      public ACE(String username, String permission)
      Constructs an ACE for a given username and permission.

      The ACE is granted.

      Since:
      6.0
  • Method Details

    • fromId

      public static ACE fromId(String aceId)
      Create an ACE from an id.
      Since:
      7.4
    • getId

      public String getId()
      Returns this ACE id.

      This id is unique inside a given ACL.

      Since:
      7.4
    • getUsername

      public String getUsername()
    • getPermission

      public String getPermission()
    • isGranted

      public boolean isGranted()
      Checks if this privilege is granted.
      Returns:
      true if the privilege is granted
    • isDenied

      public boolean isDenied()
      Checks if this privilege is denied.
      Returns:
      true if privilege is denied
    • getBegin

      public Calendar getBegin()
    • setBegin

      public void setBegin(Calendar begin)
      Sets the begin date of this ACE.

      Sets the Calendar.MILLISECOND part of the Calendar to 0.

    • getEnd

      public Calendar getEnd()
    • setEnd

      public void setEnd(Calendar end)
      Sets the end date of this ACE.

      Sets the Calendar.MILLISECOND part of the Calendar to 0.

    • getCreator

      public String getCreator()
    • setCreator

      public void setCreator(String creator)
    • getStatus

      public ACE.Status getStatus()
      Returns the status of this ACE.
      Since:
      7.4
    • getLongStatus

      public Long getLongStatus()
      Returns a Long value of this ACE status.

      It returns null if there is no begin and end date, which means the ACE is effective. Otherwise, it returns 0 for PENDING, 1 for EFFECTIVE and 2 for ARCHIVED.

      Since:
      7.4
    • isEffective

      public boolean isEffective()
    • isPending

      public boolean isPending()
    • isArchived

      public boolean isArchived()
    • getContextData

      public Serializable getContextData(String key)
    • putContextData

      public void putContextData(String key, Serializable value)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object
    • clone

      public Object clone()
      Overrides:
      clone in class Object
    • builder

      public static ACE.ACEBuilder builder(ACE ace)
      Since:
      11.3
    • builder

      public static ACE.ACEBuilder builder(String username, String permission)