[DW-1560] switch to ACTIVITI roles (#5175)

* switch to ACTIVITI roles

* double set of roles

* minor typing fixes

* use different account

* Revert "use different account"

This reverts commit 1f89fb490e8be1614fbdef391ddc8a536ec8de82.

* fix test
This commit is contained in:
Denys Vuika
2019-10-30 17:28:01 +00:00
committed by Eugenio Romano
parent 65c66528de
commit a4730cd9cf
28 changed files with 73 additions and 67 deletions

View File

@@ -30,11 +30,10 @@ export class IdentityService {
}
ROLES = {
APS_USER: 'APS_USER',
ACTIVITI_USER: 'ACTIVITI_USER',
APS_ADMIN: 'APS_ADMIN',
ACTIVITI_ADMIN: 'ACTIVITI_ADMIN',
APS_DEVOPS_USER: 'APS_DEVOPS'
ACTIVITI_DEVOPS: 'ACTIVITI_DEVOPS',
ACTIVITI_IDENTITY: 'ACTIVITI_IDENTITY'
};
async createIdentityUserWithRole(apiService: ApiService, roles: string[]): Promise<any> {

View File

@@ -28,49 +28,49 @@ export class RolesService {
async createRole(roleName: string): Promise<any> {
const path = '/roles';
const method = 'POST';
const queryParams = {}, postBody = {
const queryParams = {};
const postBody = {
name: roleName + 'TestRole'
};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
return data;
return this.api.performIdentityOperation(path, method, queryParams, postBody);
}
async deleteRole(roleId): Promise<any> {
async deleteRole(roleId: string): Promise<any> {
const path = `/roles-by-id/${roleId}`;
const method = 'DELETE';
const queryParams = {}, postBody = {};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
return data;
return this.api.performIdentityOperation(path, method, queryParams, postBody);
}
async getRoleIdByRoleName(roleName): Promise<any> {
async getRoleIdByRoleName(roleName: string): Promise<string> {
const path = `/roles`;
const method = 'GET';
let roleId;
const queryParams = {}, postBody = {};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
for (const key in data) {
if (data[key].name === roleName) {
roleId = data[key].id;
return data[key].id;
}
}
return roleId;
return undefined;
}
async getClientRoleIdByRoleName(groupId, clientId, clientRoleName): Promise<any> {
async getClientRoleIdByRoleName(groupId: string, clientId: string, clientRoleName: string): Promise<any> {
const path = `/groups/${groupId}/role-mappings/clients/${clientId}/available`;
const method = 'GET';
let clientRoleId;
const queryParams = {}, postBody = {};
const queryParams = {};
const postBody = {};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
for (const key in data) {
if (data[key].name === clientRoleName) {
clientRoleId = data[key].id;
return data[key].id;
}
}
return clientRoleId;
return undefined;
}
}

View File

@@ -31,9 +31,11 @@ export const ACTIVITI_CLOUD_APPS: any = {
formtotestvalidations: 'formtotestvalidations'
},
security: [
{'role': 'ACTIVITI_ADMIN', 'groups': [], 'users': ['superadminuser']},
{'role': 'ACTIVITI_USER', 'groups': ['hr', 'testgroup'], 'users': ['hruser'] },
{'role': 'APS_ADMIN', 'groups': [], 'users': ['superadminuser']},
{'role': 'APS_USER', 'groups': ['hr', 'testgroup'], 'users': ['hruser']
}]
{'role': 'APS_USER', 'groups': ['hr', 'testgroup'], 'users': ['hruser'] }
]
},
SIMPLE_APP: {
name: 'simpleapp',
@@ -95,16 +97,20 @@ export const ACTIVITI_CLOUD_APPS: any = {
}
},
security: [
{'role': 'ACTIVITI_ADMIN', 'groups': [], 'users': ['superadminuser']},
{'role': 'ACTIVITI_USER', 'groups': ['hr', 'testgroup'], 'users': ['hruser']},
{'role': 'APS_ADMIN', 'groups': [], 'users': ['superadminuser']},
{'role': 'APS_USER', 'groups': ['hr', 'testgroup'], 'users': ['hruser']
}]
{'role': 'APS_USER', 'groups': ['hr', 'testgroup'], 'users': ['hruser'] }
]
},
SUB_PROCESS_APP: {
name: 'subprocessapp',
file_location: 'https://github.com/Alfresco/alfresco-ng2-components/blob/development/e2e/resources/activiti7/subprocessapp.zip?raw=true',
security: [
{'role': 'ACTIVITI_ADMIN', 'groups': [], 'users': ['superadminuser']},
{'role': 'ACTIVITI_USER', 'groups': ['hr', 'testgroup'], 'users': ['hruser']},
{'role': 'APS_ADMIN', 'groups': [], 'users': ['superadminuser']},
{'role': 'APS_USER', 'groups': ['hr', 'testgroup'], 'users': ['hruser']
}]
{'role': 'APS_USER', 'groups': ['hr', 'testgroup'], 'users': ['hruser'] }
]
}
};