Fix failing unit test

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@11019 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2008-09-25 13:56:42 +00:00
parent 714b725148
commit 2a4b7c9eef

View File

@@ -661,7 +661,7 @@ public class SiteServiceImpl implements SiteService, SiteModel
} }
// If ... // If ...
// -- the current user has change permissions // -- the current user has change permissions rights on the site
// or // or
// -- the site is public and // -- the site is public and
// -- the user is ourselves and // -- the user is ourselves and
@@ -723,10 +723,8 @@ public class SiteServiceImpl implements SiteService, SiteModel
// Get the user's current role // Get the user's current role
final String currentRole = getMembersRole(shortName, userName); final String currentRole = getMembersRole(shortName, userName);
if (currentRole == null)
{
// Do nothing if the role of the user is not being changed // Do nothing if the role of the user is not being changed
if (role.equals(currentRole) == false) if (currentRole == null || role.equals(currentRole) == false)
{ {
// Determine whether the site is private or not // Determine whether the site is private or not
boolean isPublic = isSitePublic(siteNodeRef); boolean isPublic = isSitePublic(siteNodeRef);
@@ -734,7 +732,7 @@ public class SiteServiceImpl implements SiteService, SiteModel
// TODO if this is the only site manager do not downgrade their permissions // TODO if this is the only site manager do not downgrade their permissions
// If we are ... // If we are ...
// -- the site manager // -- the current user has change permissions rights on the site
// or we are ... // or we are ...
// -- refering to a public site and // -- refering to a public site and
// -- the role being set is consumer and // -- the role being set is consumer and
@@ -816,12 +814,6 @@ public class SiteServiceImpl implements SiteService, SiteModel
} }
} }
} }
else
{
// Raise a permission exception
throw new AlfrescoRuntimeException("Access denied, user does not have permissions to modify membership details of the site '" + shortName + "'");
}
}
/** /**
* @see org.alfresco.repo.site.SiteService#createContainer(java.lang.String, java.lang.String, org.alfresco.service.namespace.QName, java.util.Map) * @see org.alfresco.repo.site.SiteService#createContainer(java.lang.String, java.lang.String, org.alfresco.service.namespace.QName, java.util.Map)