mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
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:
@@ -88,7 +88,7 @@ public class ScriptAuthorityService extends BaseScopableProcessorExtension
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a group given its short name
|
* 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
|
* @return the authority or null if it can't be found
|
||||||
*/
|
*/
|
||||||
public ScriptGroup getGroup(String shortName)
|
public ScriptGroup getGroup(String shortName)
|
||||||
@@ -105,9 +105,26 @@ public class ScriptAuthorityService extends BaseScopableProcessorExtension
|
|||||||
return null;
|
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
|
* Create a new root group
|
||||||
* @return
|
* @return the new root group.
|
||||||
*/
|
*/
|
||||||
public ScriptGroup createRootGroup(String shortName, String displayName)
|
public ScriptGroup createRootGroup(String shortName, String displayName)
|
||||||
{
|
{
|
||||||
|
@@ -830,8 +830,6 @@ public class SiteServiceImplTest extends BaseAlfrescoSpringTest
|
|||||||
// From sub group four
|
// From sub group four
|
||||||
assertEquals(SiteModel.SITE_MANAGER, this.siteService.getMembersRole("testMembership", USER_FOUR));
|
assertEquals(SiteModel.SITE_MANAGER, this.siteService.getMembersRole("testMembership", USER_FOUR));
|
||||||
|
|
||||||
|
|
||||||
// Remove groups
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -124,7 +124,7 @@ public interface SiteService
|
|||||||
* Gets the role of the specified user.
|
* Gets the role of the specified user.
|
||||||
*
|
*
|
||||||
* @param shortName site short name
|
* @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
|
* @return String site role, null if none
|
||||||
*/
|
*/
|
||||||
String getMembersRole(String shortName, String authorityName);
|
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
|
* Indicates whether an authority is a member of a site or not
|
||||||
*
|
*
|
||||||
* @param shortName site short name
|
* @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
|
* @return boolean true if the authority is a member of the site, false otherwise
|
||||||
*/
|
*/
|
||||||
boolean isMember(String shortName, String authorityName);
|
boolean isMember(String shortName, String authorityName);
|
||||||
@@ -142,7 +142,7 @@ public interface SiteService
|
|||||||
* Sets the role of an authority within a site
|
* Sets the role of an authority within a site
|
||||||
*
|
*
|
||||||
* @param shortName site short name
|
* @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
|
* @param role site role
|
||||||
*/
|
*/
|
||||||
void setMembership(String shortName, String authorityName, String role);
|
void setMembership(String shortName, String authorityName, String role);
|
||||||
@@ -151,7 +151,7 @@ public interface SiteService
|
|||||||
* Clears an authorities role within a site
|
* Clears an authorities role within a site
|
||||||
*
|
*
|
||||||
* @param shortName site short name
|
* @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);
|
void removeMembership(String shortName, String authorityName);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user