Update the site name max length check - need to account for the role group names too

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@38102 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2012-06-20 23:29:13 +00:00
parent 428f8ddbbc
commit 68793785a7

View File

@@ -457,7 +457,14 @@ public class SiteServiceImpl extends AbstractLifecycleBean implements SiteServic
// Check that the site name isn't too long
// Authorities are limited to 100 characters by the PermissionService
int maximumPermisionGroupLength = 100;
int longestPermissionLength = 0;
for (String permission : permissionService.getSettablePermissions(siteType))
{
if (permission.length() > longestPermissionLength)
longestPermissionLength = permission.length();
}
int maximumPermisionGroupLength = 99 - longestPermissionLength;
if (getSiteGroup(shortName, true).length() > maximumPermisionGroupLength)
{
throw new SiteServiceException(MSG_SITE_SHORT_NAME_TOO_LONG, new Object[] {