Class ExtendedPermissionServiceImpl
java.lang.Object
org.springframework.extensions.surf.util.AbstractLifecycleBean
org.alfresco.repo.security.permissions.impl.PermissionServiceImpl
org.alfresco.repo.security.permissions.impl.ExtendedPermissionServiceImpl
- All Implemented Interfaces:
EventListener,ExtendedPermissionService,PermissionServiceSPI,PermissionService,Extensible,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener
public class ExtendedPermissionServiceImpl
extends PermissionServiceImpl
implements ExtendedPermissionService
Extends the core permission service implementation allowing the consideration of the read records permission.
This is required for SOLR support.
- Author:
- Roy Wetherall
-
Nested Class Summary
Nested classes/interfaces inherited from class org.alfresco.repo.security.permissions.impl.PermissionServiceImpl
PermissionServiceImpl.AclTest, PermissionServiceImpl.MutableBoolean, PermissionServiceImpl.NodeTest, PermissionServiceImpl.UnconditionalAclTest, PermissionServiceImpl.UnconditionalDeniedAclTest -
Field Summary
FieldsModifier and TypeFieldDescriptionConfigured Permission mapping.Configured Permission mapping.protected SimpleCache<Serializable,Set<String>> Writers simple cacheFields inherited from class org.alfresco.repo.security.permissions.impl.PermissionServiceImpl
accessCache, aclDaoComponent, allPermissionReference, anyDenyDenies, authorityService, dictionaryService, dynamicAuthorities, fixedAclUpdater, modelDAO, nodeService, ownableService, permissionsDaoComponent, policyComponent, readersCache, readersDeniedCache, tenantServiceFields inherited from interface org.alfresco.service.cmr.security.PermissionService
ADD_CHILDREN, ADMINISTRATOR_AUTHORITY, ALL_AUTHORITIES, ALL_PERMISSIONS, ASPECTS, CANCEL_CHECK_OUT, CHANGE_PERMISSIONS, CHECK_IN, CHECK_OUT, CONSUMER, CONTRIBUTOR, COORDINATOR, CREATE_ASSOCIATIONS, CREATE_CHILDREN, DELETE, DELETE_ASSOCIATIONS, DELETE_CHILDREN, DELETE_NODE, EDITOR, EXECUTE, EXECUTE_CONTENT, FULL_CONTROL, GROUP_PREFIX, GUEST_AUTHORITY, LINK_CHILDREN, LOCK, LOCK_OWNER_AUTHORITY, OWNER_AUTHORITY, PROPERTIES, READ, READ_ASSOCIATIONS, READ_CHILDREN, READ_CONTENT, READ_PERMISSIONS, READ_PROPERTIES, ROLE_PREFIX, SET_OWNER, TAKE_OWNERSHIP, UNLOCK, WRITE, WRITE_CONTENT, WRITE_PROPERTIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AccessStatusGets the file plan servicegetReaders(Long aclId) getReadersAndWriters(NodeRef nodeRef) Get the readers and writers for a given node.getReadersDenied(Long aclId) Override with check for RM readgetWriters(Long aclId) Get a set of all the authorities that have write access.hasPermission(NodeRef nodeRef, String perm) Override to deal with the possibility of hard coded permission checks in core code.protected AccessStatushasPermissionImpl(NodeRef nodeRef, String perm) Implementation of hasPermission method call.voidinit()Register the audit events.protected voidonBootstrap(org.springframework.context.ApplicationEvent event) voidsetAnyDenyDenies(boolean anyDenyDenies) voidsetConfiguredFilePermissions(String fileMapping) Maps the string set in the properties file (rm.haspermissionmap.write) to the list used in the hasPermission methodvoidsetConfiguredReadPermissions(String readMapping) Maps the string from the properties file (rm.haspermissionmap.read) to the list used in the hasPermission methodvoidsetFilePlanService(FilePlanService filePlanService) Sets the file plan servicevoidsetInheritParentPermissions(NodeRef nodeRef, boolean inheritParentPermissions) voidsetPermissionProcessorRegistry(PermissionProcessorRegistry permissionProcessorRegistry) Sets the permission processor registryvoidsetRecordsManagementAuditService(RecordsManagementAuditService recordsManagementAuditService) Set the RM audit service.voidsetWritersCache(SimpleCache<Serializable, Set<String>> writersCache) Methods inherited from class org.alfresco.repo.security.permissions.impl.PermissionServiceImpl
adminRead, beforeDeleteChildAssociation, clearPermission, clearPermission, convertVersionNodeRefToVersionedNodeRef, deletePermission, deletePermission, deletePermission, deletePermission, deletePermission, deletePermissions, deletePermissions, deletePermissions, deletePermissions, explainPermission, getAllAuthorities, getAllPermission, getAllPermissionReference, getAllPermissionsImpl, getAllSetPermissions, getAllSetPermissions, getAnyDenyDenies, getAuthorisations, getAuthorisations, getAuthorisations, getCoreAuthorisations, getDynamicAuthorities, getDynamicAuthorities, getInheritParentPermissions, getOwnerAuthority, getPermission, getPermissionReference, getPermissionReference, getPermissions, getSetPermissions, getSetPermissions, getSettablePermissionReferences, getSettablePermissionReferences, getSettablePermissions, getSettablePermissions, getTrait, hasPermission, hasPermission, hasPermission, hasReadPermission, isVersionNodeRef, onCreateChildAssociation, onMoveNode, onShutdown, ownerRead, setAccessCache, setAclDAO, setAuthorityService, setDictionaryService, setDynamicAuthorities, setFixedAclUpdater, setInheritParentPermissions, setModelDAO, setNodeService, setOwnableService, setPermission, setPermission, setPermission, setPermission, setPermission, setPermission, setPermissionsDaoComponent, setPolicyComponent, setPolicyIgnoreUtil, setReadersCache, setReadersDeniedCache, setTenantServiceMethods inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
getApplicationContext, onApplicationEvent, setApplicationContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.alfresco.service.cmr.security.PermissionService
clearPermission, clearPermission, deletePermission, deletePermission, deletePermissions, deletePermissions, getAllAuthorities, getAllPermission, getAllSetPermissions, getAllSetPermissions, getAuthorisations, getInheritParentPermissions, getOwnerAuthority, getPermissions, getSettablePermissions, getSettablePermissions, hasPermission, hasReadPermission, setInheritParentPermissions, setPermission, setPermission
-
Field Details
-
writersCache
Writers simple cache -
configuredReadPermissions
Configured Permission mapping.This string comes from alfresco-global.properties and allows fine tuning of the how permissions are mapped. This was added as a fix for MNT-16852 to enhance compatibility with our Outlook Integration.
-
configuredFilePermissions
Configured Permission mapping.This string also comes from alfresco-global.properties.
-
-
Constructor Details
-
ExtendedPermissionServiceImpl
public ExtendedPermissionServiceImpl()
-
-
Method Details
-
init
public void init()Register the audit events.- Overrides:
initin classPermissionServiceImpl
-
getFilePlanService
Gets the file plan service- Returns:
- the filePlanService
-
setFilePlanService
Sets the file plan service- Parameters:
filePlanService- the filePlanService to set
-
setPermissionProcessorRegistry
Sets the permission processor registry- Parameters:
permissionProcessorRegistry- the permissions processor registry
-
setRecordsManagementAuditService
public void setRecordsManagementAuditService(RecordsManagementAuditService recordsManagementAuditService) Set the RM audit service.- Parameters:
recordsManagementAuditService- The RM audit service.
-
setAnyDenyDenies
public void setAnyDenyDenies(boolean anyDenyDenies) - Overrides:
setAnyDenyDeniesin classPermissionServiceImpl- See Also:
-
setWritersCache
- Parameters:
writersCache- the writersCache to set
-
setConfiguredReadPermissions
Maps the string from the properties file (rm.haspermissionmap.read) to the list used in the hasPermission method- Parameters:
readMapping- the mapping of permissions to ReadRecord
-
setConfiguredFilePermissions
Maps the string set in the properties file (rm.haspermissionmap.write) to the list used in the hasPermission method- Parameters:
fileMapping- the mapping of permissions to FileRecord
-
onBootstrap
protected void onBootstrap(org.springframework.context.ApplicationEvent event) - Overrides:
onBootstrapin classPermissionServiceImpl- See Also:
-
hasPermission
Override to deal with the possibility of hard coded permission checks in core code. Note: Eventually we need to merge the RM permission model into the core to make this more robust.- Specified by:
hasPermissionin interfacePermissionService- Overrides:
hasPermissionin classPermissionServiceImpl- See Also:
-
hasPermissionImpl
Implementation of hasPermission method call.Separation also convenient for unit testing.
- Parameters:
nodeRef- node referenceperm- permission- Returns:
AccessStatusaccess status result
-
canRead
- Overrides:
canReadin classPermissionServiceImpl- See Also:
-
getReaders
- Specified by:
getReadersin interfacePermissionService- Overrides:
getReadersin classPermissionServiceImpl- See Also:
-
getReadersDenied
Override with check for RM read- Specified by:
getReadersDeniedin interfacePermissionService- Overrides:
getReadersDeniedin classPermissionServiceImpl- Parameters:
aclId-- Returns:
-
getWriters
Description copied from interface:ExtendedPermissionServiceGet a set of all the authorities that have write access.- Specified by:
getWritersin interfaceExtendedPermissionService- Parameters:
aclId- acl id- Returns:
Set<String> set of authorities with write access- See Also:
-
setInheritParentPermissions
- Specified by:
setInheritParentPermissionsin interfacePermissionService- Overrides:
setInheritParentPermissionsin classPermissionServiceImpl- See Also:
-
getReadersAndWriters
Description copied from interface:ExtendedPermissionServiceGet the readers and writers for a given node.The writers list includes the owner for the node.
- Specified by:
getReadersAndWritersin interfaceExtendedPermissionService- Parameters:
nodeRef- node reference- Returns:
- Pair<Set<String>, Set<String>> first is a set containing all the authorities that have read permission on the document and second is a set containing all the authorities that have write permission on the document, including the owner.
- See Also:
-