Package org.nuxeo.ecm.core.api.security
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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classACE.ACEBuilderstatic classACE.Status
-
Field Summary
Fields Modifier and Type Field Description static ACEBLOCKAn ACE that blocks all permissions for everyone.protected static PatternID_PATTERN
-
Constructor Summary
Constructors Constructor Description ACE()ACE(String username, String permission)Constructs an ACE for a given username and permission.ACE(String username, String permission, boolean isGranted)Constructs an ACE for a given username and permission, and specifies whether to grant or deny it.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ACE.ACEBuilderbuilder(String username, String permission)static ACE.ACEBuilderbuilder(ACE ace)Objectclone()booleanequals(Object obj)static ACEfromId(String aceId)Create an ACE from an id.CalendargetBegin()SerializablegetContextData(String key)StringgetCreator()CalendargetEnd()StringgetId()Returns this ACE id.LonggetLongStatus()Returns a Long value of this ACE status.StringgetPermission()ACE.StatusgetStatus()Returns the status of this ACE.StringgetUsername()inthashCode()booleanisArchived()booleanisDenied()Checks if this privilege is denied.booleanisEffective()booleanisGranted()Checks if this privilege is granted.booleanisPending()voidputContextData(String key, Serializable value)voidsetBegin(Calendar begin)Sets the begin date of this ACE.voidsetCreator(String creator)voidsetEnd(Calendar end)Sets the end date of this ACE.StringtoString()
-
-
-
Method Detail
-
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.MILLISECONDpart 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.MILLISECONDpart 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
nullif 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)
-
builder
public static ACE.ACEBuilder builder(ACE ace)
- Since:
- 11.3
-
builder
public static ACE.ACEBuilder builder(String username, String permission)
-
-