|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lumis.util.security.acl.AclManager
public abstract class AclManager
Base AclManager implementation. This is an abstract implementation, that contains the logic that all acls should have. Specific acl managers should extend this class.
Field Summary | |
---|---|
protected static PortalCache<AccessControlList> |
aclCache
|
Constructor Summary | |
---|---|
AclManager()
|
Method Summary | |
---|---|
protected String |
add(AccessControlList parentAcl,
HashMap<Integer,Integer> permissionsMap,
int[] implies,
ITransaction transaction)
|
void |
add(AccessControlList acl,
ITransaction transaction)
|
void |
addOrUpdate(AccessControlList acl,
ITransaction transaction)
|
boolean |
checkPermission(SessionConfig sessionConfig,
String itemId,
IPermission permission,
ITransaction transaction)
Verify if the permission is valid for the sessionConfig's user. |
boolean |
checkPermission(SessionConfig sessionConfig,
String userId,
String itemId,
IPermission permission,
ITransaction transaction)
For the given principalId, all the groups that the principal is member of (recursively) are collected and permission is calculated on this collection. |
protected void |
checkRequiredPermissionsInternal(AccessControlList acl)
Checks if the required permissions were given for someone. |
protected void |
cleanupInvalidData(AccessControlList acl)
|
void |
clearCache(ITransaction transaction)
Clears all ACL cache. |
void |
delete(String aclId,
ITransaction transaction)
Deletes an acl. |
void |
deleteAclEntryByPrincipalId(String principalId,
ITransaction transaction)
Delete ACL entries in all ACLs for the specified principal. |
String |
deserialize(SessionConfig sessionConfig,
DeserializationConfig deserializationConfig,
Node accessControlListNode,
boolean onlyAddSimpleAcls,
ITransaction transaction)
|
boolean |
exists(String aclId,
ITransaction transaction)
|
abstract AccessControlList |
get(SessionConfig sessionConfig,
String id,
ITransaction transaction)
|
protected abstract AccessControlList |
getAclInternal(SessionConfig sessionConfig,
String itemId,
ITransaction transaction)
|
protected abstract int |
getRequiredPermissions()
|
boolean |
keyExists(SessionConfig sessionConfig,
Object configKey,
Object config,
ITransaction transaction)
Checks if configId matches an already persisted object |
void |
removeFromCache(String aclId,
ITransaction transaction)
Allows removal of cached items |
void |
serialize(SessionConfig sessionConfig,
String securableId,
OutputStream outputStream,
ITransaction transaction)
|
protected void |
update(AccessControlList acl,
ITransaction transaction)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static PortalCache<AccessControlList> aclCache
Constructor Detail |
---|
public AclManager()
Method Detail |
---|
public abstract AccessControlList get(SessionConfig sessionConfig, String id, ITransaction transaction) throws ManagerException, PortalException
ManagerException
PortalException
protected abstract AccessControlList getAclInternal(SessionConfig sessionConfig, String itemId, ITransaction transaction) throws ManagerException, PortalException
ManagerException
PortalException
protected abstract int getRequiredPermissions() throws PortalException
PortalException
protected void checkRequiredPermissionsInternal(AccessControlList acl) throws PortalException
acl
- the acl to be checked.
PortalException
- if the required permissions were not given.protected String add(AccessControlList parentAcl, HashMap<Integer,Integer> permissionsMap, int[] implies, ITransaction transaction) throws PortalException
PortalException
public void add(AccessControlList acl, ITransaction transaction) throws PortalException
add
in interface IAclManager
PortalException
public boolean exists(String aclId, ITransaction transaction) throws DaoException, PortalException
exists
in interface IAclManager
DaoException
PortalException
protected void update(AccessControlList acl, ITransaction transaction) throws ManagerException, PortalException
ManagerException
PortalException
public void addOrUpdate(AccessControlList acl, ITransaction transaction) throws ManagerException, PortalException
addOrUpdate
in interface IAclManager
ManagerException
PortalException
protected void cleanupInvalidData(AccessControlList acl) throws PortalException
PortalException
public void delete(String aclId, ITransaction transaction) throws PortalException
IAclManager
This method does not delete the acl's children. They must have been deleted or the foreign key constraints will not allow their parent to be deleted.
delete
in interface IAclManager
aclId
- the id of the acl to be deleted from persistence.transaction
- the transaction for persistence access.
PortalException
public void deleteAclEntryByPrincipalId(String principalId, ITransaction transaction) throws PortalException
IAclManager
deleteAclEntryByPrincipalId
in interface IAclManager
DaoException
PortalException
public void removeFromCache(String aclId, ITransaction transaction) throws DaoException, PortalException
IAclManager
removeFromCache
in interface IAclManager
DaoException
PortalException
public void clearCache(ITransaction transaction) throws PortalException
IAclManager
clearCache
in interface IAclManager
transaction
- the transaction for persistence access. If null,
the cache is just cleared, else it is cleared as a transactional
operation as specified in PortalCache.clear(ITransaction)
.
PortalException
public boolean checkPermission(SessionConfig sessionConfig, String itemId, IPermission permission, ITransaction transaction) throws ManagerException, PortalException
IAclManager
checkPermission
in interface IAclManager
ManagerException
PortalException
public boolean checkPermission(SessionConfig sessionConfig, String userId, String itemId, IPermission permission, ITransaction transaction) throws ManagerException, PortalException
checkPermission
in interface IAclManager
ManagerException
PortalException
public void serialize(SessionConfig sessionConfig, String securableId, OutputStream outputStream, ITransaction transaction) throws ManagerException, PortalException
serialize
in interface IAclManager
ManagerException
PortalException
public String deserialize(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node accessControlListNode, boolean onlyAddSimpleAcls, ITransaction transaction) throws ManagerException, PortalException
deserialize
in interface IAclManager
ManagerException
PortalException
public boolean keyExists(SessionConfig sessionConfig, Object configKey, Object config, ITransaction transaction)
IConfigKeyChecker
keyExists
in interface IConfigKeyChecker
config
- Optional, allows a checker to read aditional fields to check composed keys
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |