mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged BRANCHES/V4.2 to HEAD:
55206: Branch created for 4.2.x releases. 55209: Merged HEAD to BRANCHES/V4.2: 55208: Added Sharepoint config to unit test classpath to fix VtiRequestDispatcherTest. 55222: Merged HEAD-BUG-FIX to V4.2 55220: Merged V4.1-BUG-FIX (4.1.7) to HEAD-BUG-FIX (4.2) 55218: Fix for ALF-19894 Site is not displayed after restoring from Trashcan This bug was reported on 4.2, but the bug is also present on 4.1. I have added a testcase to reproduce the bug along with a fix. The problem was in SiteServiceImpl.delete where the code was writing an empty property value into the {}memberships property and therefore there was no record of which users had been members of the deleted site. 55245: Fixed javadoc while checking that ALF-19055 was fixed. ActivityService no longer uses 'format 55246: CLOUD-2050 -Content changes are not synced from Cloud to On-Premise (errors in the logs) 55249: Hazelcast: Added ability to create cache with 'read-backup-data' via property *.readBackupData 55250: Hazelcast cache builder now accepts 'async-backup-count' value and any error in setting a value logs the full exception 55251: Asynchronous cache: Better logging of in- and after-transaction processes 55252: Asynchronous cache: Better logging of in- and after-transaction processes 55266: Workflow REST API fix for variable retrieval 55276: Merged HEAD to BRANCHES/V4.2: 55274: Disabling Sharepoint unit tests until we can make them run properly in the build. 55278: ALF-19889 - String for Brazilian Portuguese 55279: Merged DEV to 4.2 ALF-17464 : Replication jobs aren't displayed until sorting by some characteristic - Changing not exact equals (!==) to not euqals (!=) 55280: Fix for ALF-19865 - Forgot password link redirects to Login page. Also cleaned up the mess that is the 'Sign in to Alfresco in the cloud' dialog. 55281: Probable fix for ALF-19225 Intermittent test failures in SubscriptionServiceActivitiesTest 55282: ALF-19865 - Cloud Sync profile area now looks like the rest of profile area. 55285: Merged BRANCHES/DEV/BELARUS/HEAD-2013_08_27 to BRANCHES/V4.2: 55068: ALF-19915 : MT and WebDAV: Content is lost when uploading non-empty document 55286: Merged BRANCHES/DEV/BELARUS/HEAD-2013_08_29 to BRANCHES/V4.2: 55207: ALF-19915 : MT and WebDAV: Content is lost when uploading non-empty document 55210: ALF-19915 : MT and WebDAV: Content is lost when uploading non-empty document 55297: As part of prep work for fixing ALF-20023 Recent Sites and Favorite Sites in copy/move pickers empty, 55299: ALF-19556: IE10 specific fix for file upload browse (impressive how IE finds more and more innovative ways to spoil things for itself) 55300: Fixed date issue when creating a new process instance 55308: Resync to HEAD@55302 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@55309 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1454,6 +1454,9 @@ public class SiteServiceImpl extends AbstractLifecycleBean implements SiteServic
|
||||
*/
|
||||
public void deleteSite(final String shortName)
|
||||
{
|
||||
// In deleting the site node, we have to jump through a few hoops to manage the site groups.
|
||||
// The order of execution is important here.
|
||||
|
||||
logger.debug("delete site :" + shortName);
|
||||
final NodeRef siteNodeRef = getSiteNodeRef(shortName);
|
||||
if (siteNodeRef == null)
|
||||
@@ -1465,11 +1468,35 @@ public class SiteServiceImpl extends AbstractLifecycleBean implements SiteServic
|
||||
// Delete the cached reference
|
||||
siteNodeRefCache.remove(shortName);
|
||||
|
||||
// Collection for recording the group memberships present on the site
|
||||
final Map<String, Set<String>> groupsMemberships = new HashMap<String, Set<String>>();
|
||||
|
||||
// Save the group memberships so we can use them later
|
||||
this.nodeService.setProperty(siteNodeRef, QName.createQName(null, "memberships"), (Serializable)groupsMemberships);
|
||||
// Get and retain the membership of the site we're deleting. We do this to support restoration of a site node from the trashcan.
|
||||
AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Void>()
|
||||
{
|
||||
public Void doWork() throws Exception
|
||||
{
|
||||
final String siteGroup = getSiteGroup(shortName, true);
|
||||
if (authorityService.authorityExists(siteGroup))
|
||||
{
|
||||
// Collection for recording the group memberships present on the site
|
||||
final Map<String, Set<String>> groupsMemberships = new HashMap<String, Set<String>>();
|
||||
|
||||
// Iterate over the role related groups and delete then
|
||||
Set<String> permissions = permissionService.getSettablePermissions(siteType);
|
||||
for (String permission : permissions)
|
||||
{
|
||||
String siteRoleGroup = getSiteRoleGroup(shortName, permission, true);
|
||||
|
||||
// Collect up the memberships so we can potentially restore them later
|
||||
Set<String> groupUsers = authorityService.getContainedAuthorities(null, siteRoleGroup, true);
|
||||
groupsMemberships.put(siteRoleGroup, groupUsers);
|
||||
}
|
||||
|
||||
// Save the group memberships so we can use them later
|
||||
nodeService.setProperty(siteNodeRef, QName.createQName(null, "memberships"), (Serializable)groupsMemberships);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
|
||||
// The default behaviour is that sites cannot be deleted. But we disable that behaviour here
|
||||
// in order to allow site deletion only via this service. Share calls this service for deletion.
|
||||
@@ -1493,7 +1520,7 @@ public class SiteServiceImpl extends AbstractLifecycleBean implements SiteServic
|
||||
// Delete the associated groups
|
||||
AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Object>()
|
||||
{
|
||||
public Object doWork() throws Exception
|
||||
public Void doWork() throws Exception
|
||||
{
|
||||
// Delete the master site group
|
||||
final String siteGroup = getSiteGroup(shortName, true);
|
||||
@@ -1507,10 +1534,6 @@ public class SiteServiceImpl extends AbstractLifecycleBean implements SiteServic
|
||||
{
|
||||
String siteRoleGroup = getSiteRoleGroup(shortName, permission, true);
|
||||
|
||||
// Collect up the memberships so we can potentially restore them later
|
||||
Set<String> groupUsers = authorityService.getContainedAuthorities(null, siteRoleGroup, true);
|
||||
groupsMemberships.put(siteRoleGroup, groupUsers);
|
||||
|
||||
// Delete the site role group
|
||||
authorityService.deleteAuthority(siteRoleGroup);
|
||||
}
|
||||
|
Reference in New Issue
Block a user