Package lumis.util.security.acl
Class AccessControlList
- java.lang.Object
-
- lumis.util.security.acl.AccessControlList
-
- All Implemented Interfaces:
java.lang.Cloneable
,ICacheEntry
,ICloneableCacheEntry
,ICloneableConfig<AccessControlList>
public class AccessControlList extends java.lang.Object implements ICloneableConfig<AccessControlList>, ICloneableCacheEntry
Value class for Access Control Lists- Since:
- 4.0.7
- Version:
- $Revision$ $Date$
-
-
Field Summary
Fields Modifier and Type Field Description static int
REMOVE_INHERIT_COPY_PERMISSIONS
static int
REMOVE_INHERIT_REMOVE_PERMISSIONS
-
Constructor Summary
Constructors Constructor Description AccessControlList(java.lang.String id, AccessControlEntry[] accessControlEntries, boolean inheriting)
AccessControlList(java.lang.String id, AccessControlEntry[] accessControlEntries, boolean inheriting, java.lang.String parentId)
Creates a new access control list with the data given.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
checkPermission(java.lang.String principalId, IPermission permission)
Checks if the specified principal has access to the given permission.boolean
checkPermission(java.util.Collection<java.lang.String> principalIds, IPermission permission)
Deprecated.Since 4.2.1, this method is no longer used and may be removed in the future.AccessControlList
clone()
void
deserialize(org.w3c.dom.Node accessControlListNode)
AccessControlEntry[]
getEntries()
AccessControlEntry
getEntry(java.lang.String entryId)
java.lang.String
getId()
AccessControlEntry[]
getLocalEntries()
java.lang.String
getParentId()
void
inherit(AccessControlList parentAccessControlList)
void
inherit(AccessControlList parentAccessControlList, java.util.HashMap<java.lang.Integer,java.lang.Integer> permissionsMapping)
boolean
isInheriting()
void
removeInheritance(int removeType)
void
serialize(AccessControlList accessControlList, java.io.OutputStream outputStream)
void
setImpliedPermissions(int[] permissionImplies)
void
setInheriting(boolean inheriting)
void
setLocalEntries(AccessControlEntry[] entries)
void
setParentId(java.lang.String parentId)
-
-
-
Field Detail
-
REMOVE_INHERIT_COPY_PERMISSIONS
public static final int REMOVE_INHERIT_COPY_PERMISSIONS
- See Also:
- Constant Field Values
-
REMOVE_INHERIT_REMOVE_PERMISSIONS
public static final int REMOVE_INHERIT_REMOVE_PERMISSIONS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AccessControlList
public AccessControlList(java.lang.String id, AccessControlEntry[] accessControlEntries, boolean inheriting)
-
AccessControlList
public AccessControlList(java.lang.String id, AccessControlEntry[] accessControlEntries, boolean inheriting, java.lang.String parentId)
Creates a new access control list with the data given.The parentACL is not currently read from parentId. It is filled only when
inherit(lumis.util.security.acl.AccessControlList)
method is called. On theinherit(lumis.util.security.acl.AccessControlList)
method, the parentId is also filled.
-
-
Method Detail
-
getId
public java.lang.String getId()
-
isInheriting
public boolean isInheriting()
-
setInheriting
public void setInheriting(boolean inheriting)
-
getParentId
public java.lang.String getParentId()
-
setParentId
public void setParentId(java.lang.String parentId)
-
getEntry
public AccessControlEntry getEntry(java.lang.String entryId)
-
getEntries
public AccessControlEntry[] getEntries()
-
getLocalEntries
public AccessControlEntry[] getLocalEntries()
-
setLocalEntries
public void setLocalEntries(AccessControlEntry[] entries)
-
setImpliedPermissions
public void setImpliedPermissions(int[] permissionImplies)
-
inherit
public void inherit(AccessControlList parentAccessControlList)
-
inherit
public void inherit(AccessControlList parentAccessControlList, java.util.HashMap<java.lang.Integer,java.lang.Integer> permissionsMapping)
-
removeInheritance
public void removeInheritance(int removeType)
-
checkPermission
@Deprecated public boolean checkPermission(java.util.Collection<java.lang.String> principalIds, IPermission permission)
Deprecated.Since 4.2.1, this method is no longer used and may be removed in the future.Checks if any of the given principlas have access to the given permission. If any of the principals are explicitly "denied" permission, this method returns false. Otherwise if any of the principals have access to the given permission, this method returns true.- Parameters:
principalIds
-permission
-- Returns:
-
checkPermission
public boolean checkPermission(java.lang.String principalId, IPermission permission) throws PortalException
Checks if the specified principal has access to the given permission. This permission check is done taking into account the principal's groups recursively.This method needs a transactional context to be executed.
- Parameters:
principalId
- the principal identifier.permission
- the permission.- Returns:
- true if the principal has access to the given permission, false otherwise.
- Throws:
PortalException
-
serialize
public void serialize(AccessControlList accessControlList, java.io.OutputStream outputStream) throws PortalException
- Throws:
PortalException
-
deserialize
public void deserialize(org.w3c.dom.Node accessControlListNode) throws PortalException
- Throws:
PortalException
-
clone
public AccessControlList clone() throws java.lang.CloneNotSupportedException
- Specified by:
clone
in interfaceICloneableCacheEntry
- Specified by:
clone
in interfaceICloneableConfig<AccessControlList>
- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
-