Package org.alfresco.rest.v0.service
Class RoleService
- java.lang.Object
-
- org.alfresco.rest.v0.service.RoleService
-
@Service public class RoleService extends Object
Produces processed results from roles API calls- Since:
- 2.6
- Author:
- Rodica Sutu
-
-
Constructor Summary
Constructors Constructor Description RoleService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCapabilitiesToRole(UserRoles role, Set<String> capabilities)Add capabilities to a rolevoidassignUserPermissionsOnCategoryAndRMRole(org.alfresco.utility.model.UserModel user, String categoryId, UserPermissions userPermission, String userRole)Assign permission on a record category and give the user RM roleorg.alfresco.utility.model.UserModelcreateCollaboratorWithRMRoleAndPermission(org.alfresco.utility.model.SiteModel siteModel, RecordCategory recordCategory, UserRoles userRole, UserPermissions userPermission)Helper method to create a user with rm role and permissions over the recordCategory and collaborator role in collaboration siteorg.alfresco.utility.model.UserModelcreateUserWithRMRole(String userRole)Helper method to create a test user with rm roleorg.alfresco.utility.model.UserModelcreateUserWithRMRoleAndCategoryPermission(String userRole, RecordCategory recordCategory, UserPermissions userPermission)Helper method to create a test user with rm role and permissions over the record categoryorg.alfresco.utility.model.UserModelcreateUserWithRMRoleAndRMNodePermission(String userRole, String componentId, UserPermissions userPermission)Helper method to create a user with rm role and permissions on the node reforg.alfresco.utility.model.UserModelcreateUserWithSiteRoleRMRoleAndPermission(org.alfresco.utility.model.SiteModel siteModel, org.alfresco.utility.constants.UserRole userSiteRole, String rmNodeId, UserRoles userRole, UserPermissions userPermission)Helper method to create a test user with a rm role and permissions over a rm component and a role in collaboration siteSet<String>getRoleCapabilities(String roleName)Get the capabilities for a rolevoidremoveCapabilitiesFromRole(UserRoles role, Set<String> capabilities)Remove capabilities from a role
-
-
-
Method Detail
-
getRoleCapabilities
public Set<String> getRoleCapabilities(String roleName)
Get the capabilities for a role- Parameters:
roleName- the role name- Returns:
- the list of capabilities
-
addCapabilitiesToRole
public void addCapabilitiesToRole(UserRoles role, Set<String> capabilities)
Add capabilities to a role- Parameters:
role- role to be updatedcapabilities- list of capabilities to be added
-
removeCapabilitiesFromRole
public void removeCapabilitiesFromRole(UserRoles role, Set<String> capabilities)
Remove capabilities from a role- Parameters:
role- role to be updatedcapabilities- list of capabilities to be removed
-
assignUserPermissionsOnCategoryAndRMRole
public void assignUserPermissionsOnCategoryAndRMRole(org.alfresco.utility.model.UserModel user, String categoryId, UserPermissions userPermission, String userRole)Assign permission on a record category and give the user RM role- Parameters:
user- the user to assign rm role and permissionscategoryId- the id of the category to assign permissions foruserPermission- the permissions to be assigned to the useruserRole- the rm role to be assigned to the user
-
createUserWithRMRole
public org.alfresco.utility.model.UserModel createUserWithRMRole(String userRole)
Helper method to create a test user with rm role- Parameters:
userRole- the rm role- Returns:
- the created user model
-
createUserWithRMRoleAndCategoryPermission
public org.alfresco.utility.model.UserModel createUserWithRMRoleAndCategoryPermission(String userRole, RecordCategory recordCategory, UserPermissions userPermission)
Helper method to create a test user with rm role and permissions over the record category- Parameters:
userRole- the rm roleuserPermission- the permissions over the record categoryrecordCategory- the category on which user has permissions- Returns:
- the created user model
-
createUserWithRMRoleAndRMNodePermission
public org.alfresco.utility.model.UserModel createUserWithRMRoleAndRMNodePermission(String userRole, String componentId, UserPermissions userPermission)
Helper method to create a user with rm role and permissions on the node ref- Parameters:
userRole- the rm roleuserPermission- the permissions over the rm nodecomponentId- the node id to grant rm permission- Returns:
- the created user model
-
createCollaboratorWithRMRoleAndPermission
public org.alfresco.utility.model.UserModel createCollaboratorWithRMRoleAndPermission(org.alfresco.utility.model.SiteModel siteModel, RecordCategory recordCategory, UserRoles userRole, UserPermissions userPermission)Helper method to create a user with rm role and permissions over the recordCategory and collaborator role in collaboration site- Parameters:
siteModel- collaboration siterecordCategory- the category on which permission should be givenuserRole- the rm roleuserPermission- the permissions over the recordCategory- Returns:
- the created user model
-
createUserWithSiteRoleRMRoleAndPermission
public org.alfresco.utility.model.UserModel createUserWithSiteRoleRMRoleAndPermission(org.alfresco.utility.model.SiteModel siteModel, org.alfresco.utility.constants.UserRole userSiteRole, String rmNodeId, UserRoles userRole, UserPermissions userPermission)Helper method to create a test user with a rm role and permissions over a rm component and a role in collaboration site- Parameters:
siteModel- collaboration siteuserSiteRole- user role in the collaboration sitermNodeId- rm node id to grant rm permissionuserRole- the rm roleuserPermission- the permissions over the rmNodeId- Returns:
- the created user model
-
-