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 class
ACE.ACEBuilder
static class
ACE.Status
-
Field Summary
Fields Modifier and Type Field Description static ACE
BLOCK
An ACE that blocks all permissions for everyone.protected static Pattern
ID_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.ACEBuilder
builder(String username, String permission)
static ACE.ACEBuilder
builder(ACE ace)
Object
clone()
boolean
equals(Object obj)
static ACE
fromId(String aceId)
Create an ACE from an id.Calendar
getBegin()
Serializable
getContextData(String key)
String
getCreator()
Calendar
getEnd()
String
getId()
Returns this ACE id.Long
getLongStatus()
Returns a Long value of this ACE status.String
getPermission()
ACE.Status
getStatus()
Returns the status of this ACE.String
getUsername()
int
hashCode()
boolean
isArchived()
boolean
isDenied()
Checks if this privilege is denied.boolean
isEffective()
boolean
isGranted()
Checks if this privilege is granted.boolean
isPending()
void
putContextData(String key, Serializable value)
void
setBegin(Calendar begin)
Sets the begin date of this ACE.void
setCreator(String creator)
void
setEnd(Calendar end)
Sets the end date of this ACE.String
toString()
-
-
-
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.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)
-
builder
public static ACE.ACEBuilder builder(ACE ace)
- Since:
- 11.3
-
builder
public static ACE.ACEBuilder builder(String username, String permission)
-
-