Ensure create category behaviour is executed with sufficient rights.

* fixes FileToCreatePathIntegration test



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@62554 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2014-02-13 20:56:28 +00:00
parent 805495ef3e
commit 728a5bd7bb

View File

@@ -154,15 +154,26 @@ public class RecordCategoryType extends BaseBehaviourBean
kind = BehaviourKind.CLASS, kind = BehaviourKind.CLASS,
notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT
) )
public void onCreateNode(ChildAssociationRef childAssocRef) public void onCreateNode(final ChildAssociationRef childAssocRef)
{ {
if (logger.isDebugEnabled() == true) if (logger.isDebugEnabled() == true)
{ {
logger.debug("rma:recordCategory|alf:onCreateNode|this.onCreateNode()|TRANSATION_COMMIT"); logger.debug("rma:recordCategory|alf:onCreateNode|this.onCreateNode()|TRANSATION_COMMIT");
} }
// setup record category permissions // execute behaviour code as system user
filePlanPermissionService.setupRecordCategoryPermissions(childAssocRef.getChildRef()); AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
{
@Override
public Void doWork() throws Exception
{
// setup record category permissions
filePlanPermissionService.setupRecordCategoryPermissions(childAssocRef.getChildRef());
return null;
}
});
} }
/** /**