Implementing Web Site Group Membership.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14342 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2009-05-18 12:44:04 +00:00
parent adc8a8ff9c
commit 6e09838e9c
3 changed files with 23 additions and 8 deletions

View File

@@ -88,7 +88,7 @@ public class ScriptAuthorityService extends BaseScopableProcessorExtension
/**
* Get a group given its short name
* @param shortName
* @param shortName, the shortName of the group
* @return the authority or null if it can't be found
*/
public ScriptGroup getGroup(String shortName)
@@ -105,9 +105,26 @@ public class ScriptAuthorityService extends BaseScopableProcessorExtension
return null;
}
/**
* Get a group given it full authority name (Which must begin with 'GROUP_'
* @param fullAuthorityName, the shortName of the group
* @return the authority or null if it can't be found
*/
public ScriptGroup getGroupForFullAuthorityName(String fullAuthorityName)
{
if (authorityService.authorityExists(fullAuthorityName))
{
ScriptGroup group = new ScriptGroup(fullAuthorityName, authorityService);
return group;
}
// group not found.
return null;
}
/**
* Create a new root group
* @return
* @return the new root group.
*/
public ScriptGroup createRootGroup(String shortName, String displayName)
{

View File

@@ -830,8 +830,6 @@ public class SiteServiceImplTest extends BaseAlfrescoSpringTest
// From sub group four
assertEquals(SiteModel.SITE_MANAGER, this.siteService.getMembersRole("testMembership", USER_FOUR));
// Remove groups
}
/**

View File

@@ -124,7 +124,7 @@ public interface SiteService
* Gets the role of the specified user.
*
* @param shortName site short name
* @param authorityName authority name
* @param authorityName full authority name (so if it's a group then its prefixed with 'GROUP_')
* @return String site role, null if none
*/
String getMembersRole(String shortName, String authorityName);
@@ -133,7 +133,7 @@ public interface SiteService
* Indicates whether an authority is a member of a site or not
*
* @param shortName site short name
* @param authorityName authority name
* @param authorityName authority name (so if it's a group then its prefixed with 'GROUP_')
* @return boolean true if the authority is a member of the site, false otherwise
*/
boolean isMember(String shortName, String authorityName);
@@ -142,7 +142,7 @@ public interface SiteService
* Sets the role of an authority within a site
*
* @param shortName site short name
* @param authorityName authority name
* @param authorityName authority name (so if it's a group then its prefixed with 'GROUP_')
* @param role site role
*/
void setMembership(String shortName, String authorityName, String role);
@@ -151,7 +151,7 @@ public interface SiteService
* Clears an authorities role within a site
*
* @param shortName site short name
* @param authorityName authority name
* @param authorityName authority name (so if it's a group then its prefixed with 'GROUP_')
*/
void removeMembership(String shortName, String authorityName);