mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-8639] Discovery OpenId - Load discovery and pass info to jsapi (#7632)
* Load discovery and pass info to jsapi * fix the roles empty scenario tests * Make lint happier * Rename the initApi method * Add secret field Co-authored-by: arditdomi <ardit.domi@hyland.com>
This commit is contained in:
@@ -38,9 +38,13 @@ export class AuthGuardSsoRoleService implements CanActivate {
|
||||
if (route.data) {
|
||||
if (route.data['roles']) {
|
||||
const rolesToCheck: string[] = route.data['roles'];
|
||||
const excludedRoles = route.data['excludedRoles'] || [];
|
||||
const isContentAdmin = rolesToCheck.includes(ContentGroups.ALFRESCO_ADMINISTRATORS) || excludedRoles.includes(ContentGroups.ALFRESCO_ADMINISTRATORS) ? await this.peopleContentService.isContentAdmin() : false;
|
||||
hasRealmRole = excludedRoles.length ? this.checkAccessWithExcludedRoles(rolesToCheck, excludedRoles, isContentAdmin) : this.hasRoles(rolesToCheck, isContentAdmin);
|
||||
if (rolesToCheck.length === 0) {
|
||||
hasRealmRole = true;
|
||||
} else {
|
||||
const excludedRoles = route.data['excludedRoles'] || [];
|
||||
const isContentAdmin = rolesToCheck.includes(ContentGroups.ALFRESCO_ADMINISTRATORS) || excludedRoles.includes(ContentGroups.ALFRESCO_ADMINISTRATORS) ? await this.peopleContentService.isContentAdmin() : false;
|
||||
hasRealmRole = excludedRoles.length ? this.checkAccessWithExcludedRoles(rolesToCheck, excludedRoles, isContentAdmin) : this.hasRoles(rolesToCheck, isContentAdmin);
|
||||
}
|
||||
}
|
||||
|
||||
if (route.data['clientRoles']) {
|
||||
|
Reference in New Issue
Block a user