mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-4985] - Make SSO Role Service accept a content admin role that is not part of the JWT token (#6942)
* Add ability to check if the user is an ACS_ADMIN - not part of JTW token * Make get user api call only once * Add unit tests * Add documentation * Fix comments * Exclude flaky tests, dependent on another test * Fix unit test * Fix comments * Update documentation
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
import { EcmCompanyModel } from '../models/ecm-company.model';
|
||||
import { PersonEntry, Person } from '@alfresco/js-api';
|
||||
|
||||
export let fakeEcmCompany: EcmCompanyModel = {
|
||||
organization: 'company-fake-name',
|
||||
@@ -99,3 +100,25 @@ export const createNewPersonMock = {
|
||||
password: 'fake-avatar-id',
|
||||
email: 'fakeEcm@ecmUser.com'
|
||||
};
|
||||
|
||||
export function getFakeUserWithContentAdminCapability(): PersonEntry {
|
||||
const fakeEcmUserWithAdminCapabilities = {
|
||||
...fakeEcmUser,
|
||||
capabilities: {
|
||||
isAdmin: true
|
||||
}
|
||||
};
|
||||
const mockPerson = new Person(fakeEcmUserWithAdminCapabilities);
|
||||
return { entry: mockPerson };
|
||||
}
|
||||
|
||||
export function getFakeUserWithContentUserCapability(): PersonEntry {
|
||||
const fakeEcmUserWithAdminCapabilities = {
|
||||
...fakeEcmUser,
|
||||
capabilities: {
|
||||
isAdmin: false
|
||||
}
|
||||
};
|
||||
const mockPerson = new Person(fakeEcmUserWithAdminCapabilities);
|
||||
return { entry: mockPerson };
|
||||
}
|
||||
|
Reference in New Issue
Block a user