public abstract class AclManager extends Object implements IAclManager
Modifier and Type | Field and Description |
---|---|
protected static PortalCache<AccessControlList> |
aclCache |
protected static ThreadLocal<Boolean> |
checkRequiredPermissionsInternalFlag |
Constructor and Description |
---|
AclManager() |
Modifier and Type | Method and Description |
---|---|
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) |
protected static PortalCache<AccessControlList> aclCache
protected static final ThreadLocal<Boolean> checkRequiredPermissionsInternalFlag
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 keysLumisXP 12.3.0.200408 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.