Resolving role naming conflicts
This commit is contained in:
parent
24bfd69e4d
commit
9f781853a7
|
@ -2,6 +2,6 @@ package eu.eudat.service.keycloak;
|
|||
|
||||
public enum KeycloakRole {
|
||||
|
||||
Admin, DatasetTemplateEditor, DatasetProfileManager, Manager, User
|
||||
Admin, DescriptionTemplateEditor, Manager, User
|
||||
|
||||
}
|
||||
|
|
|
@ -9,9 +9,6 @@ keycloak-resources:
|
|||
Manager:
|
||||
groupId: 1753f7a7-cedb-4ad4-ae5f-96fe9bdabe3e
|
||||
groupTitle: role-manager
|
||||
DatasetProfileManager:
|
||||
groupId: 969aa109-9c4d-4f12-ba9b-4a84b2e5a394
|
||||
groupTitle: role-dataset-template-editor
|
||||
DatasetTemplateEditor:
|
||||
groupId: 969aa109-9c4d-4f12-ba9b-4a84b2e5a394
|
||||
groupTitle: role-dataset-template-editor
|
||||
DescriptionTemplateEditor:
|
||||
groupId: b0ea3cf3-21b0-4c6b-9c42-fb09f0e09dbb
|
||||
groupTitle: role-description-template-editor
|
|
@ -13,9 +13,9 @@ permissions:
|
|||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
||||
DatasetProfileManagerRole:
|
||||
DescriptionTemplateEditorRole:
|
||||
roles:
|
||||
- DatasetProfileManager
|
||||
- DescriptionTemplateEditor
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
||||
|
@ -244,21 +244,21 @@ permissions:
|
|||
BrowseDescriptionTemplate:
|
||||
roles:
|
||||
- Admin
|
||||
- DatasetProfileManager
|
||||
- DescriptionTemplateEditor
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
||||
EditDescriptionTemplate:
|
||||
roles:
|
||||
- Admin
|
||||
- DatasetProfileManager
|
||||
- DescriptionTemplateEditor
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
||||
DeleteDescriptionTemplate:
|
||||
roles:
|
||||
- Admin
|
||||
- DatasetProfileManager
|
||||
- DescriptionTemplateEditor
|
||||
claims: [ ]
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
|
@ -266,7 +266,7 @@ permissions:
|
|||
CloneDescriptionTemplate:
|
||||
roles:
|
||||
- Admin
|
||||
- DatasetProfileManager
|
||||
- DescriptionTemplateEditor
|
||||
claims: [ ]
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
|
@ -274,7 +274,7 @@ permissions:
|
|||
CreateNewVersionDescriptionTemplate:
|
||||
roles:
|
||||
- Admin
|
||||
- DatasetProfileManager
|
||||
- DescriptionTemplateEditor
|
||||
claims: [ ]
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
|
@ -282,7 +282,7 @@ permissions:
|
|||
ImportDescriptionTemplate:
|
||||
roles:
|
||||
- Admin
|
||||
- DatasetProfileManager
|
||||
- DescriptionTemplateEditor
|
||||
claims: [ ]
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
|
@ -290,7 +290,7 @@ permissions:
|
|||
ExportDescriptionTemplate:
|
||||
roles:
|
||||
- Admin
|
||||
- DatasetProfileManager
|
||||
- DescriptionTemplateEditor
|
||||
claims: [ ]
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
|
|
|
@ -2,5 +2,5 @@ export enum AppRole {
|
|||
Admin = "Admin",
|
||||
Manager = "Manager",
|
||||
User = "User",
|
||||
DatasetTemplateEditor = "DatasetProfileManager"
|
||||
DescriptionTemplateEditor = "DescriptionTemplateEditor"
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ export class EnumUtils {
|
|||
case AppRole.Admin: return this.language.instant('TYPES.APP-ROLE.ADMIN');
|
||||
case AppRole.User: return this.language.instant('TYPES.APP-ROLE.USER');
|
||||
case AppRole.Manager: return this.language.instant('TYPES.APP-ROLE.MANAGER');
|
||||
case AppRole.DatasetTemplateEditor: return this.language.instant('TYPES.APP-ROLE.DESCRIPTION-TEMPLATE-EDITOR');
|
||||
case AppRole.DescriptionTemplateEditor: return this.language.instant('TYPES.APP-ROLE.DESCRIPTION-TEMPLATE-EDITOR');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ const routes: Routes = [
|
|||
data: {
|
||||
title: 'GENERAL.TITLES.DATASET-PROFILES-NEW',
|
||||
authContext: {
|
||||
permissions: [AppRole.Admin, AppRole.DatasetTemplateEditor]
|
||||
permissions: [AppRole.Admin, AppRole.DescriptionTemplateEditor]
|
||||
}
|
||||
},
|
||||
canActivate: [SpecialAuthGuard],
|
||||
|
@ -26,7 +26,7 @@ const routes: Routes = [
|
|||
data: {
|
||||
title: 'GENERAL.TITLES.DATASET-PROFILES-EDIT',
|
||||
authContext: {
|
||||
permissions: [AppRole.Admin, AppRole.DatasetTemplateEditor]
|
||||
permissions: [AppRole.Admin, AppRole.DescriptionTemplateEditor]
|
||||
}
|
||||
},
|
||||
canActivate: [SpecialAuthGuard],
|
||||
|
@ -38,7 +38,7 @@ const routes: Routes = [
|
|||
data: {
|
||||
title: 'GENERAL.TITLES.DATASET-PROFILES-CLONE',
|
||||
authContext: {
|
||||
permissions: [AppRole.Admin, AppRole.DatasetTemplateEditor]
|
||||
permissions: [AppRole.Admin, AppRole.DescriptionTemplateEditor]
|
||||
}
|
||||
},
|
||||
canActivate: [SpecialAuthGuard],
|
||||
|
@ -50,7 +50,7 @@ const routes: Routes = [
|
|||
data: {
|
||||
title: 'GENERAL.TITLES.DATASET-PROFILES-NEW-VERSION',
|
||||
authContext: {
|
||||
permissions: [AppRole.Admin, AppRole.DatasetTemplateEditor]
|
||||
permissions: [AppRole.Admin, AppRole.DescriptionTemplateEditor]
|
||||
}
|
||||
},
|
||||
canActivate: [SpecialAuthGuard],
|
||||
|
@ -61,7 +61,7 @@ const routes: Routes = [
|
|||
component: DatasetProfileListingComponent,
|
||||
data: {
|
||||
authContext: {
|
||||
permissions: [AppRole.Admin, AppRole.DatasetTemplateEditor]
|
||||
permissions: [AppRole.Admin, AppRole.DescriptionTemplateEditor]
|
||||
}
|
||||
},
|
||||
canActivate: [SpecialAuthGuard]
|
||||
|
@ -71,7 +71,7 @@ const routes: Routes = [
|
|||
component: DatasetProfileListingComponent,
|
||||
data: {
|
||||
authContext: {
|
||||
permissions: [AppRole.Admin, AppRole.DatasetTemplateEditor]
|
||||
permissions: [AppRole.Admin, AppRole.DescriptionTemplateEditor]
|
||||
}
|
||||
},
|
||||
canActivate: [SpecialAuthGuard]
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div *ngIf="!this.nowEditing"class="roles col">
|
||||
<ng-container *ngFor="let role of this.formGroup.get('roles').value">
|
||||
<div>
|
||||
<span class="user-role" [ngClass]="{'user': role == appRole.User, 'manager': role == appRole.Manager, 'admin': role == appRole.Admin, 'dataset-template-editor': role == appRole.DatasetTemplateEditor}">
|
||||
<span class="user-role" [ngClass]="{'user': role == appRole.User, 'manager': role == appRole.Manager, 'admin': role == appRole.Admin, 'description-template-editor': role == appRole.DescriptionTemplateEditor}">
|
||||
{{enumUtils.toAppRoleString(role)}}
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.dataset-template-editor {
|
||||
.description-template-editor {
|
||||
// display: flex;
|
||||
// justify-content: center;
|
||||
// align-items: center;
|
||||
|
|
|
@ -159,7 +159,7 @@ export class SidebarComponent implements OnInit {
|
|||
title: 'SIDE-BAR.ADMIN',
|
||||
routes: DATASET_TEMPLATE_ROUTES,
|
||||
requiresAuthentication: true,
|
||||
requiresSpecialPermission: AppRole.DatasetTemplateEditor,
|
||||
requiresSpecialPermission: AppRole.DescriptionTemplateEditor,
|
||||
requiresAdmin: false,
|
||||
isGeneral: false
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue