public class UndeletableAspect extends Object implements NodeServicePolicies.BeforeDeleteNodePolicy
ContentModel.ASPECT_UNDELETABLE
are not allowed by default.
This class registers the behaviour that prevents the deletion.
This aspect/behaviour combination allows for detailed application control of when node deletion is allowed
or disallowed for particular nodes. It is not related to the normal permissions controls, which of course apply.
An example of its usage is in the SiteService
, where SiteModel.TYPE_SITE
nodes are given the
ContentModel.ASPECT_UNDELETABLE
as a mandatory aspect. Therefore any attempt to delete such a node will
result in an exception. However, this behaviour is disabled within the SiteService
in order to allow
site node deletion from within that service but from no other code.Policy.Arg
QNAME
Constructor and Description |
---|
UndeletableAspect() |
Modifier and Type | Method and Description |
---|---|
void |
beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Ensures that undeletable nodes cannot be deleted by default.
|
void |
init()
Initialise method
|
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Set the node service
|
void |
setPolicyComponent(PolicyComponent policyComponent)
Set the policy component
|
public void setPolicyComponent(PolicyComponent policyComponent)
policyComponent
- policy componentpublic void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService
- node servicepublic void init()
public void beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
beforeDeleteNode
in interface NodeServicePolicies.BeforeDeleteNodePolicy
nodeRef
- the node referenceCopyright © 2005–2017 Alfresco Software. All rights reserved.