MT - System "runAs" will run in MT-context

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8277 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2008-02-14 10:21:12 +00:00
parent d141885e6d
commit 2bde146829
5 changed files with 48 additions and 17 deletions

View File

@@ -167,8 +167,8 @@ public class AuditableAspect
// Set the updated property values (but do not cascade to update audit behaviour)
onUpdateAudit.disable();
// note: special MT case - need to run in context of user's domain ... although checkForLock requires System
AuthenticationUtil.runAs(new SetAuditProperties(nodeService, nodeRef, properties), tenantService.getDomainUser(AuthenticationUtil.getSystemUserName(), tenantService.getCurrentUserDomain()));
// note: in MT case, this will run in System context of user's domain ... checkForLock requires System
AuthenticationUtil.runAs(new SetAuditProperties(nodeService, nodeRef, properties), AuthenticationUtil.getSystemUserName());
}
finally
{
@@ -201,8 +201,8 @@ public class AuditableAspect
// Set the updated property values
// note: special MT case - need to run in context of user's domain ... although checkForLock requires System
AuthenticationUtil.runAs(new SetAuditProperties(nodeService, nodeRef, properties), tenantService.getDomainUser(AuthenticationUtil.getSystemUserName(), tenantService.getCurrentUserDomain()));
// note: in MT case, this will run in System context of user's domain ... checkForLock requires System
AuthenticationUtil.runAs(new SetAuditProperties(nodeService, nodeRef, properties), AuthenticationUtil.getSystemUserName());
if (logger.isDebugEnabled())
logger.debug("Auditable node " + nodeRef + " updated [modified=" + now + ";modifier=" + modifier + "]");