Skip to content

Commit

Permalink
update roles changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kbeyro committed Jan 23, 2024
1 parent f0f0dd0 commit 9cf9865
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/app/appmarket/domains/domains.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import {BulkViewComponent} from '../bulkDeployment/bulk-view/bulk-view.component
export const DomainsRoutes: Route[] = [
{
path: 'admin/domains', component: DomainsListComponent, canActivate: [AuthGuard, RoleGuard],
data: {roles: ['ROLE_SYSTEM_ADMIN', 'ROLE_DOMAIN_ADMIN', 'ROLE_OPERATOR', 'ROLE_VL_DOMAIN']}
data: {roles: ['ROLE_SYSTEM_ADMIN', 'ROLE_DOMAIN_ADMIN', 'ROLE_OPERATOR', 'ROLE_VL_DOMAIN_ADMIN']}
},
{
path: 'admin/domains/add', component: DomainComponent, canActivate: [AuthGuard, RoleGuard],
data: {mode: ComponentMode.CREATE, roles: ['ROLE_SYSTEM_ADMIN']}
},
{
path: 'admin/domains/view/:id', component: DomainComponent, canActivate: [AuthGuard, RoleGuard],
data: {mode: ComponentMode.VIEW, roles: ['ROLE_SYSTEM_ADMIN', 'ROLE_DOMAIN_ADMIN', 'ROLE_OPERATOR', 'ROLE_VL_DOMAIN']}
data: {mode: ComponentMode.VIEW, roles: ['ROLE_SYSTEM_ADMIN', 'ROLE_DOMAIN_ADMIN', 'ROLE_OPERATOR', 'ROLE_VL_DOMAIN_ADMIN']}
},
{
path: 'admin/domains/edit/:id', component: DomainComponent, canActivate: [AuthGuard, RoleGuard],
Expand Down
2 changes: 1 addition & 1 deletion src/app/appmarket/domains/list/domainslist.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class DomainsListComponent implements OnInit {
map((domains) => domains.filter((domain) => domain.id !== this.domainService.getGlobalDomainId())));
} else {
return this.domainService.getMyDomains().pipe(
map((domains) => domains.filter((domain) => this.authService.hasDomainRole(domain.id, Role[Role.ROLE_DOMAIN_ADMIN]) || this.authService.hasDomainRole(domain.id, Role[Role.ROLE_VL_DOMAIN]))));
map((domains) => domains.filter((domain) => this.authService.hasDomainRole(domain.id, Role[Role.ROLE_DOMAIN_ADMIN]) || this.authService.hasDomainRole(domain.id, Role[Role.ROLE_VL_DOMAIN_ADMIN]))));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/appmarket/users/list/userslist.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class UsersListComponent implements OnInit {
users = this.userService.getDomainUsersAsAdmin(this.domainId);
} else if (this.authService.hasRole(Role[Role.ROLE_SYSTEM_ADMIN])) {
users = this.userService.getAll(this.domainId);
} else if (this.domainId != null && (this.authService.hasDomainRole(this.domainId, Role[Role.ROLE_DOMAIN_ADMIN]) || this.authService.hasDomainRole(this.domainId, Role[Role.ROLE_VL_DOMAIN]))) {
} else if (this.domainId != null && (this.authService.hasDomainRole(this.domainId, Role[Role.ROLE_DOMAIN_ADMIN]) || this.authService.hasDomainRole(this.domainId, Role[Role.ROLE_VL_DOMAIN_ADMIN]))) {
this.domainMode = true;
users = this.userService.getAll(this.domainId);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/app/model/userrole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export enum Role {
ROLE_INCOMPLETE,
ROLE_NOT_ACCEPTED,
ROLE_VL_MANAGER,
ROLE_VL_DOMAIN
ROLE_VL_DOMAIN_ADMIN
}

export function RoleAware(constructor: Function) {
Expand Down
4 changes: 2 additions & 2 deletions src/app/shared/navbar/navbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<li *roles="['ROLE_SYSTEM_ADMIN', 'ROLE_TOOL_MANAGER']"><a
[routerLink]="['/admin/apps']">{{ 'NAVBAR.MARKET' | translate }}</a>
</li>
<li *roles="['ROLE_DOMAIN_ADMIN', 'ROLE_SYSTEM_ADMIN', 'ROLE_OPERATOR', 'ROLE_VL_MANAGER', 'ROLE_VL_DOMAIN']"><a
<li *roles="['ROLE_DOMAIN_ADMIN', 'ROLE_SYSTEM_ADMIN', 'ROLE_OPERATOR', 'ROLE_VL_MANAGER', 'ROLE_VL_DOMAIN_ADMIN']"><a
[routerLink]="['/admin/domains']">{{ 'NAVBAR.DOMAINS' | translate }}</a>
</li>
<li *roles="['ROLE_SYSTEM_ADMIN', 'ROLE_VL_MANAGER']">
Expand All @@ -75,7 +75,7 @@
<li *roles="['ROLE_SYSTEM_ADMIN']"><a
[routerLink]="['/admin/users']">{{ 'NAVBAR.USERS' | translate }}</a>
</li>
<li *roles="['ROLE_DOMAIN_ADMIN', 'ROLE_VL_MANAGER', 'ROLE_VL_DOMAIN']"><a
<li *roles="['ROLE_DOMAIN_ADMIN', 'ROLE_VL_MANAGER', 'ROLE_VL_DOMAIN_ADMIN']"><a
[routerLink]="['/domain/users']">{{ 'NAVBAR.DOMAIN_USERS' | translate }}</a>
</li>
<li *roles="['ROLE_SYSTEM_ADMIN']"><a
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/users/list/userslist.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ <h3>
{{ 'USERS.TITLE' | translate }}</h3>
<div class="flex space-between">
<div class="flex">
<button *ngIf="authService.hasDomainRole(domainId, 'ROLE_DOMAIN_ADMIN') || authService.hasDomainRole(domainId, 'ROLE_VL_DOMAIN')"
<button *ngIf="authService.hasDomainRole(domainId, 'ROLE_DOMAIN_ADMIN') || authService.hasDomainRole(domainId, 'ROLE_VL_DOMAIN_ADMIN')"
class="btn btn-primary" (click)="changeMode()">
<span *ngIf="isModeAllowed(ComponentMode.DELETE)">{{'USERS.ADD_TO_DOMAIN_BUTTON' | translate}}</span>
<span *ngIf="isModeAllowed(ComponentMode.EDIT)">{{'USERS.GO_BACK_BUTTON' | translate}}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class UserPrivilegesComponent extends BaseComponent implements OnInit {
roles = this.filterRoles(roles, this.newPrivilegeForm.get('domainId').value);
} else if (this.newPrivilegeForm.get('domainId').value != null) {
// default (domain) role set
roles = [Role.ROLE_GUEST, Role.ROLE_USER, Role.ROLE_DOMAIN_ADMIN, Role.ROLE_VL_DOMAIN];
roles = [Role.ROLE_GUEST, Role.ROLE_USER, Role.ROLE_DOMAIN_ADMIN, Role.ROLE_VL_DOMAIN_ADMIN];
roles = this.filterRoles(roles, this.newPrivilegeForm.get('domainId').value);
} else {
// no roles
Expand Down

0 comments on commit 9cf9865

Please sign in to comment.