Add getRoles
This commit is contained in:
parent
6cd7fe3204
commit
bd10842a53
@ -848,6 +848,19 @@ export class Service {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getRoles(process: Process): Record<string, RoleDefinition> | null {
|
||||||
|
const lastCommitedState = this.getLastCommitedState(process);
|
||||||
|
if (lastCommitedState && lastCommitedState.roles && Object.keys(lastCommitedState.roles).length != 0) {
|
||||||
|
return lastCommitedState!.roles;
|
||||||
|
} else if (process.states.length === 2) {
|
||||||
|
const firstState = process.states[0];
|
||||||
|
if (firstState && firstState.roles && Object.keys(firstState.roles).length != 0) {
|
||||||
|
return firstState!.roles;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public rolesContainsUs(roles: Record<string, RoleDefinition>): boolean {
|
public rolesContainsUs(roles: Record<string, RoleDefinition>): boolean {
|
||||||
let us;
|
let us;
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user