Merged V3.1 to HEAD

14919: Merged V2.2 to V3.1
        14785: Fix for ETWOTWO-1164: Newly created access groups for web projects are not deleted when the project is removed


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14950 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrew Hind
2009-06-26 09:39:30 +00:00
parent 5500f162b4
commit 9c630f07f3
2 changed files with 27 additions and 1 deletions

View File

@@ -1340,4 +1340,28 @@ public final class SandboxFactory extends WCMUtil
this.userAuth = userAuth;
}
}
public void removeGroupsForStore(final String storeRoot)
{
AuthenticationUtil.runAs(new RunAsWork<Void>()
{
public Void doWork() throws Exception
{
String[] permissions = new String[] { PermissionService.WCM_CONTENT_CONTRIBUTOR, PermissionService.WCM_CONTENT_MANAGER, PermissionService.WCM_CONTENT_PUBLISHER,
PermissionService.WCM_CONTENT_REVIEWER };
for (String permission : permissions)
{
String shortName = storeRoot + "-" + permission;
String group = authorityService.getName(AuthorityType.GROUP, shortName);
if (authorityService.authorityExists(group))
{
authorityService.deleteAuthority(group);
}
}
return null;
}
}, AuthenticationUtil.getSystemUserName());
}
}