mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
transform UserPermissions in enum; add helper methods to create users with rm role, permissions or clearance
(cherry picked from commit e8725860eb
)
# 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:
@@ -57,8 +57,9 @@ public class FilesAPI extends RMModelRequest
|
||||
* @param fileId The Id of a file to declare as record
|
||||
* @param parameters Request parameters, refer to API documentation for more details
|
||||
* @return The {@link Record} for created record
|
||||
* @throws Exception for malformed JSON responses
|
||||
*/
|
||||
public Record declareAsRecord(String fileId, String parameters)
|
||||
public Record declareAsRecord(String fileId, String parameters) throws Exception
|
||||
{
|
||||
mandatoryString("fileId", fileId);
|
||||
|
||||
@@ -75,8 +76,9 @@ public class FilesAPI extends RMModelRequest
|
||||
*
|
||||
* @param fileId The Id of a file to declare as record
|
||||
* @return The {@link Record} for created record
|
||||
* @throws Exception for malformed JSON responses
|
||||
*/
|
||||
public Record declareAsRecord(String fileId)
|
||||
public Record declareAsRecord(String fileId) throws Exception
|
||||
{
|
||||
mandatoryString("fileId", fileId);
|
||||
|
||||
|
@@ -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
|
||||
*
|
||||
|
@@ -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 },
|
||||
|
Reference in New Issue
Block a user