mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.2 to HEAD
8049: Fix for WCM-1033: Only admin users can create web projects 8051: Merged V2.1 to V2.2 8006: Merged V2.1-A to V2.1 (Virtual Server fixes) 7723: The JMX server connector is now lazily instantiated in the server context. 7734: Fix for WCM-934. 7735: The linkvalidation service now provides a public API 7742: Possible fix for ACT #361 8012: Merged V2.1-A to V2.1 7749: Fix stack overflow 7955: Fix for issue ADB-18 Forward slash '/' in username causes Advanced Search failure 7975: AR-1832: Allow setting of timeout value in the Java webservices client 7995: Include the alf_child_assoc.type_qname in the check for duplicate children. 8052: Build fix 8054: Merged V2.1 to V2.2 8045: Patch fix to solve WCM-1051 - also reruns fixed patch on previously patched repos (see CHK-2143) 8058: Fixed compilation issues following merge git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8466 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -24,16 +24,21 @@
|
||||
*/
|
||||
package org.alfresco.repo.admin.patch.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.i18n.I18NUtil;
|
||||
import org.alfresco.model.WCMAppModel;
|
||||
import org.alfresco.repo.admin.patch.AbstractPatch;
|
||||
import org.alfresco.repo.importer.ImporterBootstrap;
|
||||
import org.alfresco.repo.search.Indexer;
|
||||
import org.alfresco.repo.search.IndexerAndSearcher;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.search.ResultSet;
|
||||
import org.alfresco.service.cmr.search.ResultSetRow;
|
||||
import org.alfresco.service.cmr.search.SearchParameters;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.service.cmr.security.PermissionService;
|
||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
|
||||
/**
|
||||
* Patch to break the inheritance of permissions on AVM Web Project Folders.
|
||||
@@ -81,7 +86,23 @@ public class AVMWebProjectInheritPermissionsPatch extends AbstractPatch
|
||||
rs = searchService.query(sp);
|
||||
for (ResultSetRow row : rs)
|
||||
{
|
||||
// break permission inheritance for the Web Project nodes
|
||||
this.permissionService.setInheritParentPermissions(row.getNodeRef(), false);
|
||||
|
||||
// ensure that permissions are explicitly assigned for all Content Manager roles
|
||||
List<ChildAssociationRef> userInfoRefs = this.nodeService.getChildAssocs(
|
||||
row.getNodeRef(), WCMAppModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL);
|
||||
for (ChildAssociationRef ref : userInfoRefs)
|
||||
{
|
||||
NodeRef userInfoRef = ref.getChildRef();
|
||||
String username = (String)nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERNAME);
|
||||
String userrole = (String)nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERROLE);
|
||||
|
||||
if ("ContentManager".equals(userrole))
|
||||
{
|
||||
this.permissionService.setPermission(row.getNodeRef(), username, "ContentManager", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
|
Reference in New Issue
Block a user