transform UserPermissions in enum; add helper methods to create users with rm role, permissions or clearance

(cherry picked from commit ebc860ea2a)

# Conflicts:
#	rm-automation/rm-automation-enterprise-rest-api/src/test/java/org/alfresco/rest/rm/enterprise/v0/classification/content/SetRMExemptionReasonTest.java
This commit is contained in:
cagache
2019-04-23 12:15:38 +03:00
committed by Rodica Sutu
parent ed02c79096
commit 2a9aca2ced
3 changed files with 21 additions and 3 deletions

View File

@@ -616,6 +616,22 @@ public class BaseRMRestTest extends RestTest
recordCategoryAPI.deleteRecordCategory(recordCategoryId);
}
/**
* Assign permission on a record category and give the user RM role
*
* @param user the user to assign rm role and permissions
* @param categoryId the id of the category to assign permissions for
* @param userPermission the permissions to be assigned to the user
* @param userRole the rm role to be assigned to the user
*/
public void assignUserPermissionsOnCategoryAndRMRole(UserModel user, String categoryId, UserPermissions userPermission,
String userRole)
{
getRestAPIFactory().getRMUserAPI().addUserPermission(categoryId, user, userPermission);
rmRolesAndActionsAPI.assignRoleToUser(getAdminUser().getUsername(), getAdminUser().getPassword(),
user.getUsername(), userRole);
}
/**
* Helper method to create a test user with rm role
*

View File

@@ -105,7 +105,7 @@ public class DataProviderClass
* @return file plan component alias
*/
@DataProvider
public static String[][] categoryTypes()
public static Object[][] categoryTypes()
{
return new String[][] {
{ FOLDER_TYPE },