mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-07 18:25:23 +00:00
Fix failing unit test. Cascade delete site groups on site deletion.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14641 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
parent
d8228cb23f
commit
e5c375d103
@ -294,9 +294,21 @@ public class AuthorityServiceImpl implements AuthorityService, InitializingBean
|
||||
}
|
||||
|
||||
public void deleteAuthority(String name)
|
||||
{
|
||||
deleteAuthority(name, false);
|
||||
}
|
||||
|
||||
public void deleteAuthority(String name, boolean cascade)
|
||||
{
|
||||
AuthorityType type = AuthorityType.getAuthorityType(name);
|
||||
checkTypeIsMutable(type);
|
||||
if (cascade)
|
||||
{
|
||||
for (String child : getContainedAuthorities(type, name, true))
|
||||
{
|
||||
deleteAuthority(child, true);
|
||||
}
|
||||
}
|
||||
authorityDAO.deleteAuthority(name);
|
||||
permissionServiceSPI.deletePermissions(name);
|
||||
}
|
||||
|
@ -201,6 +201,11 @@ public class SimpleAuthorityServiceImpl implements AuthorityService
|
||||
|
||||
}
|
||||
|
||||
public void deleteAuthority(String name, boolean cascade)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Set<String> getAllRootAuthorities(AuthorityType type)
|
||||
{
|
||||
return getAllAuthorities(type);
|
||||
|
@ -926,12 +926,12 @@ public class SiteServiceImpl implements SiteService, SiteModel
|
||||
// Delete the node
|
||||
this.nodeService.deleteNode(siteNodeRef);
|
||||
|
||||
// Delete the associated group's
|
||||
// Delete the associated groups
|
||||
AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Object>()
|
||||
{
|
||||
public Object doWork() throws Exception
|
||||
{
|
||||
authorityService.deleteAuthority(getSiteGroup(shortName, true));
|
||||
authorityService.deleteAuthority(getSiteGroup(shortName, true), true);
|
||||
return null;
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
|
@ -190,13 +190,25 @@ public interface AuthorityService
|
||||
public void removeAuthority(String parentName, String childName);
|
||||
|
||||
/**
|
||||
* Delete an authority and all its relationships.
|
||||
* Delete an authority and all its relationships. Note child authorities are not deleted.
|
||||
*
|
||||
* @param name
|
||||
*/
|
||||
@Auditable(parameters = {"name"})
|
||||
public void deleteAuthority(String name);
|
||||
|
||||
/**
|
||||
* Delete an authority and all its relationships, optionally recursively deleting child authorities of the same
|
||||
* type.
|
||||
*
|
||||
* @param name
|
||||
* the authority long name
|
||||
* @param cascade
|
||||
* should the delete be cascaded to child authorities of the same type?
|
||||
*/
|
||||
@Auditable(parameters = {"name", "cascade"})
|
||||
public void deleteAuthority(String name, boolean cascade);
|
||||
|
||||
/**
|
||||
* Get all the authorities that are contained by the given authority.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user