Merged 5.0.N (5.0.4) to 5.1.N (5.1.2) (PARTIAL MERGE)

129068 kroast: ESC-476, MNT-16162
   Folder access in 'private' sites using site path url fails versus repository url path
   SHA-1682
   Granular Permissions File and Folder Access for non-site members
   - Navigating to a Document Library folder link in the search results page to a folder you have been given access to in a private site. You can now navigate to the folder and all sub-folders you have been given access to within that private site.
   - Navigating to a Document Details page link in the search results page to a document you have been given access to in a private site. 
    - The Tags 'Could not retrieve tags' and the Tree component "Site not found: ..." messages have been made less aggressive looking within the Document Library views - the red background has been removed.
    - The private site missing title (was blank previously) in the title area has been replaced with the site url name which is all the user is able to resolve given the private permissions for the site object.
   See tickets for more detail on fixes and what functionality is available.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@129148 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2016-08-05 12:44:14 +00:00
parent 6e156464a1
commit 34d5d64737

View File

@@ -368,6 +368,35 @@ public class ScriptSiteService extends BaseScopableProcessorExtension
return site;
}
/**
* Get a site for a provided site short name. If the current user does not have permission to view the site content, the info
* will still be returned, but none of the operations that would modify site information on save() will work. As usual ACLs
* will apply on any attempt to modify the Site object.
* <p>
* Returns null if the site does not exist.
*
* @param shortName short name of the site
* @return Site the site, null if does not exist
*/
public Site getSiteInfo(final String shortName)
{
Site site = null;
SiteInfo siteInfo = AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<SiteInfo>()
{
public SiteInfo doWork() throws Exception
{
return siteService.getSite(shortName);
}
}, AuthenticationUtil.getAdminUserName());
if (siteInfo != null)
{
site = new Site(siteInfo, this.serviceRegistry, this.siteService, getScope());
}
return site;
}
/**
* Returns an array of all the roles that can be assigned to a member of a site.
*