mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merge from DEV/SITE_CONFIGURABILITY to HEAD
22049: ALF-3786 Partial implementation of Configurable Site Creation Group. Site configuration groups can be configured via permissions management in the usual way. This check-in adds hasCreateSitePermissions() to various SiteService layers to better support client code when site creation restrictions have been imposed. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22053 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -299,6 +299,21 @@ public class SiteServiceImpl implements SiteService, SiteModel
|
|||||||
PropertyCheck.mandatory(this, "authorityService", authorityService);
|
PropertyCheck.mandatory(this, "authorityService", authorityService);
|
||||||
PropertyCheck.mandatory(this, "sitesXPath", sitesXPath);
|
PropertyCheck.mandatory(this, "sitesXPath", sitesXPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
* @see org.alfresco.service.cmr.site.SiteService#hasCreateSitePermissions()
|
||||||
|
*/
|
||||||
|
public boolean hasCreateSitePermissions()
|
||||||
|
{
|
||||||
|
final NodeRef siteRoot = getSiteRoot();
|
||||||
|
if (siteRoot == null)
|
||||||
|
{
|
||||||
|
throw new SiteServiceException("No root sites folder exists");
|
||||||
|
}
|
||||||
|
boolean result = permissionService.hasPermission(siteRoot, PermissionService.CONTRIBUTOR).equals(AccessStatus.ALLOWED);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.alfresco.service.cmr.site.SiteService#createSite(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean)
|
* @see org.alfresco.service.cmr.site.SiteService#createSite(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean)
|
||||||
|
@@ -104,6 +104,17 @@ public class ScriptSiteService extends BaseScopableProcessorExtension
|
|||||||
return new Site(siteInfo, this.serviceRegistry, this.siteService, getScope());
|
return new Site(siteInfo, this.serviceRegistry, this.siteService, getScope());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method checks if the currently authenticated user has permission to create sites.
|
||||||
|
*
|
||||||
|
* @return <code>true</code> if the current user is a Contributor to "Sites" node, else <code>false</code>.
|
||||||
|
* @since 3.4
|
||||||
|
*/
|
||||||
|
public boolean hasCreateSitePermissions()
|
||||||
|
{
|
||||||
|
return siteService.hasCreateSitePermissions();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List the sites available in the repository. The returned list can optionally be filtered by name and site
|
* List the sites available in the repository. The returned list can optionally be filtered by name and site
|
||||||
* preset.
|
* preset.
|
||||||
|
@@ -65,6 +65,15 @@ public interface SiteService
|
|||||||
@Auditable(parameters = {"sitePreset", "shortName"})
|
@Auditable(parameters = {"sitePreset", "shortName"})
|
||||||
SiteInfo createSite(String sitePreset, String shortName, String title, String description, SiteVisibility visibility);
|
SiteInfo createSite(String sitePreset, String shortName, String title, String description, SiteVisibility visibility);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method checks if the currently authenticated user has permission to create sites.
|
||||||
|
*
|
||||||
|
* @return <code>true</code> if current user can create sites, else <code>false</code>.
|
||||||
|
* @since 3.4
|
||||||
|
*/
|
||||||
|
@NotAuditable
|
||||||
|
boolean hasCreateSitePermissions();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List the available sites. This list can optionally be filtered by site name and/or site preset.
|
* List the available sites. This list can optionally be filtered by site name and/or site preset.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user