Skip to content

Commit

Permalink
Merge pull request #1465 from GNS3/rbac-tweaking
Browse files Browse the repository at this point in the history
Adjustments for RBAC system
  • Loading branch information
grossmj authored Oct 6, 2023
2 parents 73c9fd3 + c7b5d0d commit 931b7b1
Show file tree
Hide file tree
Showing 32 changed files with 54 additions and 54 deletions.
18 changes: 9 additions & 9 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ import { GroupResolver } from "./resolvers/group.resolver";
import { GroupRoleResolver } from "./resolvers/group-role.resolver";
import { RoleDetailComponent } from "./components/role-management/role-detail/role-detail.component";
import { RoleDetailResolver } from "./resolvers/role-detail.resolver";
import {AceManagementComponent} from "@components/ace-management/ace-management.component";
import {ResourcePoolsManagementComponent} from "@components/resource-pools-management/resource-pools-management.component";
import {ResourcePoolDetailsComponent} from "@components/resource-pool-details/resource-pool-details.component";
import {ResourcePoolsResolver} from "@resolvers/resource-pools.resolver";
import {GroupAcesResolver} from "@resolvers/group-ace.resolver.ts.resolver";
import {UserAcesResolver} from "@resolvers/user-aces.resolver";
import { AclManagementComponent } from "@components/acl-management/acl-management.component";
import { ResourcePoolsManagementComponent } from "@components/resource-pools-management/resource-pools-management.component";
import { ResourcePoolDetailsComponent } from "@components/resource-pool-details/resource-pool-details.component";
import { ResourcePoolsResolver } from "@resolvers/resource-pools.resolver";
import { GroupAcesResolver } from "@resolvers/group-ace.resolver.ts.resolver";
import { UserAcesResolver } from "@resolvers/user-aces.resolver";

const routes: Routes = [
{
Expand Down Expand Up @@ -249,12 +249,12 @@ const routes: Routes = [
component: RoleManagementComponent
},
{
path: "resourcePools",
path: "pools",
component: ResourcePoolsManagementComponent
},
{
path: 'aces',
component: AceManagementComponent
path: 'ACL',
component: AclManagementComponent
}
]
},
Expand Down
14 changes: 7 additions & 7 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,13 @@ import { ExportPortableProjectComponent } from './components/export-portable-pro
import { NodesMenuConfirmationDialogComponent } from './components/project-map/nodes-menu/nodes-menu-confirmation-dialog/nodes-menu-confirmation-dialog.component';
import { ConfirmationDeleteAllProjectsComponent } from './components/projects/confirmation-delete-all-projects/confirmation-delete-all-projects.component';
import { ProjectMapLockConfirmationDialogComponent } from './components/project-map/project-map-menu/project-map-lock-confirmation-dialog/project-map-lock-confirmation-dialog.component';
import {AceManagementComponent} from "@components/ace-management/ace-management.component";
import { AddAceDialogComponent } from './components/ace-management/add-ace-dialog/add-ace-dialog.component';
import { AutocompleteComponent } from './components/ace-management/add-ace-dialog/autocomplete/autocomplete.component';
import { DeleteAceDialogComponent } from './components/ace-management/delete-ace-dialog/delete-ace-dialog.component';
import { AclManagementComponent } from "@components/acl-management/acl-management.component";
import { AddAceDialogComponent } from './components/acl-management/add-ace-dialog/add-ace-dialog.component';
import { AutocompleteComponent } from './components/acl-management/add-ace-dialog/autocomplete/autocomplete.component';
import { DeleteAceDialogComponent } from './components/acl-management/delete-ace-dialog/delete-ace-dialog.component';
import { AceFilterPipe } from './filters/ace-filter.pipe';
import {CdkAccordionModule} from "@angular/cdk/accordion";
import {CdkTreeModule} from "@angular/cdk/tree";
import { CdkAccordionModule } from "@angular/cdk/accordion";
import { CdkTreeModule } from "@angular/cdk/tree";

import { PrivilegeComponent } from './components/role-management/role-detail/privilege/privilege.component';
import { GroupPrivilegesPipe } from './components/role-management/role-detail/privilege/group-privileges.pipe';
Expand Down Expand Up @@ -547,7 +547,7 @@ import { DeleteResourceConfirmationDialogComponent } from './components/resource
NodesMenuConfirmationDialogComponent,
ConfirmationDeleteAllProjectsComponent,
ProjectMapLockConfirmationDialogComponent,
AceManagementComponent,
AclManagementComponent,
AddAceDialogComponent,
AutocompleteComponent,
DeleteAceDialogComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="content" *ngIf="isReady; else loading">
<div class="default-header">
<div class="row">
<h1 class="col">ACEs management</h1>
<h1 class="col">Access Control List (ACL)</h1>
<button class="col" mat-raised-button color="primary" (click)="deleteMultiple()" class="add-ace-button" [disabled]="selection.selected.length == 0">
Delete selected ACEs
</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { AceManagementComponent } from './ace-management.component';
import { AclManagementComponent } from './acl-management.component';

describe('AceManagementComponent', () => {
let component: AceManagementComponent;
let fixture: ComponentFixture<AceManagementComponent>;
describe('AclManagementComponent', () => {
let component: AclManagementComponent;
let fixture: ComponentFixture<AclManagementComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ AceManagementComponent ]
declarations: [ AclManagementComponent ]
})
.compileComponents();

fixture = TestBed.createComponent(AceManagementComponent);
fixture = TestBed.createComponent(AclManagementComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ import {AclService} from "@services/acl.service";
import {MatPaginator} from "@angular/material/paginator";
import {MatSort} from "@angular/material/sort";
import {AddUserDialogComponent} from "@components/user-management/add-user-dialog/add-user-dialog.component";
import {AddAceDialogComponent} from "@components/ace-management/add-ace-dialog/add-ace-dialog.component";
import {AddAceDialogComponent} from "@components/acl-management/add-ace-dialog/add-ace-dialog.component";
import {DeleteUserDialogComponent} from "@components/user-management/delete-user-dialog/delete-user-dialog.component";
import {DeleteAceDialogComponent} from "@components/ace-management/delete-ace-dialog/delete-ace-dialog.component";
import {DeleteAceDialogComponent} from "@components/acl-management/delete-ace-dialog/delete-ace-dialog.component";
import {User} from "@models/users/user";
import {Endpoint} from "@models/api/endpoint";

@Component({
selector: 'app-ace-management',
templateUrl: './ace-management.component.html',
styleUrls: ['./ace-management.component.scss']
selector: 'app-acl-management',
templateUrl: './acl-management.component.html',
styleUrls: ['./acl-management.component.scss']
})
export class AceManagementComponent implements OnInit {
export class AclManagementComponent implements OnInit {


@ViewChildren('acesPaginator') acesPaginator: QueryList<MatPaginator>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {EndpointTreeAdapter} from "@components/ace-management/add-ace-dialog/EndpointTreeAdapter";
import {EndpointTreeAdapter} from "@components/acl-management/add-ace-dialog/EndpointTreeAdapter";
import {Endpoint, RessourceType} from "@models/api/endpoint";

const endpoint1: Endpoint = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {Role} from "@models/api/role";
import {RoleService} from "@services/role.service";
import {NestedTreeControl} from "@angular/cdk/tree";
import {ArrayDataSource} from "@angular/cdk/collections";
import {EndpointNode, EndpointTreeAdapter} from "@components/ace-management/add-ace-dialog/EndpointTreeAdapter";
import {EndpointNode, EndpointTreeAdapter} from "@components/acl-management/add-ace-dialog/EndpointTreeAdapter";



Expand Down
4 changes: 2 additions & 2 deletions src/app/components/group-details/group-details.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[routerLink]="['/controller', controller.id, 'management', 'groups']">
<mat-icon aria-label="Back to group management">keyboard_arrow_left</mat-icon>
</a>
<h1 class="col">Groups {{group.name}} details</h1>
<h1 class="col">Group {{group.name}}</h1>
</div>
<mat-tab-group>
<mat-tab label="Details" class="details">
Expand Down Expand Up @@ -56,7 +56,7 @@ <h1 class="col">Groups {{group.name}} details</h1>
[pageSizeOptions]="[5, 20, 50, 100]"></mat-paginator>
</div>
</mat-tab>
<mat-tab label="Aces">
<mat-tab label="ACEs">
<div class="default-content">
<table mat-table [dataSource]="aceDatasource" class="mat-elevation-z8">

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="content" *ngIf="isReady; else loading">
<div class="default-header">
<div class="row">
<h1 class="col">Groups management</h1>
<h1 class="col">Groups</h1>
<button class="col" mat-raised-button color="primary" (click)="onDelete(selection.selected)" class="add-group-button" [disabled]="selection.selected.length == 0">
Delete selected groups
</button>
Expand All @@ -13,7 +13,7 @@ <h1 class="col">Groups management</h1>

<form>
<mat-form-field class="full-width">
<input matInput placeholder="Search by name" [(ngModel)]="searchText" [ngModelOptions]="{ standalone: true }" />
<input matInput placeholder="Search group by name" [(ngModel)]="searchText" [ngModelOptions]="{ standalone: true }" />
</mat-form-field>
</form>

Expand Down
2 changes: 1 addition & 1 deletion src/app/components/management/management.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {ControllerService} from "@services/controller.service";
export class ManagementComponent implements OnInit {

controller: Controller;
links = ['users', 'groups', 'roles', 'resourcePools', 'aces'];
links = ['users', 'groups', 'roles', 'pools', 'ACL'];
activeLink: string = this.links[0];

constructor(
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/projects/projects.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1 class="col">Projects</h1>

<form>
<mat-form-field class="full-width">
<input matInput placeholder="Search by name" [(ngModel)]="searchText" [ngModelOptions]="{ standalone: true }" />
<input matInput placeholder="Search project by name" [(ngModel)]="searchText" [ngModelOptions]="{ standalone: true }" />
</mat-form-field>
</form>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
[routerLink]="['/controller', controller.id, 'management', 'resourcePools']">
<mat-icon aria-label="back to resource pools management">keyboard_arrow_left</mat-icon>
</a>
<h1 class="col">Pool {{pool.name}} details</h1>
<h1 class="col">Resource pool {{pool.name}}</h1>
</div>
<div class="main">
<div class="details">
<div>
<mat-form-field>
<mat-label>pool name:</mat-label>
<mat-label>Resource pool name:</mat-label>
<input matInput type="text" [(ngModel)]="pool.name">
</mat-form-field>
</div>
Expand All @@ -23,7 +23,7 @@ <h1 class="col">Pool {{pool.name}} details</h1>
<div>uuid: {{pool.resource_pool_id}}</div>
<div mat-dialog-actions class="button-div">
<button mat-button (click)="onUpdate()" tabindex="2" mat-raised-button color="primary">
update pool
Update resource pool
</button>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1 mat-dialog-title>Create new pool</h1>
<h1 mat-dialog-title>Create new resource pool</h1>
<form [formGroup]="poolNameForm" class="file-name-form">
<mat-form-field class="file-name-form-field">
<input
Expand All @@ -7,24 +7,24 @@ <h1 mat-dialog-title>Create new pool</h1>
type="text"
formControlName="poolName"
[ngClass]="{ 'is-invalid': form.poolName?.errors }"
placeholder="Please enter a pool name"
placeholder="Please enter a resource pool name"
/>
<mat-error *ngIf="form.poolName?.touched && form.poolName?.errors && form.poolName?.errors.required"
>Pool name is required</mat-error
>Resource pool name is required</mat-error
>
<mat-error *ngIf="form.poolName?.errors && form.poolName?.errors.invalidName"
>Pool name is incorrect</mat-error
>Resource pool name is incorrect</mat-error
>
<mat-error *ngIf="form.poolName?.errors && form.poolName?.errors.projectExist"
>Pool with this name exists</mat-error
>Resource pool with this name exists</mat-error
>
</mat-form-field>
</form>

<div mat-dialog-actions class="button-div">
<button mat-button (click)="onNoClick()" color="accent">Cancel</button>
<button mat-button (click)="onAddClick()" tabindex="2" class="add-project-button" mat-raised-button color="primary">
Add Pool
Add resource pool
</button>
</div>

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="content" *ngIf="isReady; else loading">
<div class="default-header">
<div class="row">
<h1 class="col">Resource Pools management</h1>
<h1 class="col">Resource pools</h1>
<button class="col" mat-raised-button color="primary" (click)="onDelete(selection.selected)"
class="add-ressourcePool-button" [disabled]="selection.selected.length == 0">
Delete selected pools
Expand All @@ -14,7 +14,7 @@ <h1 class="col">Resource Pools management</h1>

<form>
<mat-form-field class="full-width">
<input matInput placeholder="Search by name" [(ngModel)]="searchText"
<input matInput placeholder="Search resource pool by name" [(ngModel)]="searchText"
[ngModelOptions]="{ standalone: true }"/>
</mat-form-field>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[routerLink]="['/controller', controller.id, 'management', 'roles']">
<mat-icon aria-label="Back to role management">keyboard_arrow_left</mat-icon>
</a>
<h1 class="col">Role {{($role | async)?.name}} details</h1>
<h1 class="col">Role {{($role | async)?.name}}</h1>
</div>
<div class="main">
<div class="details">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="content" *ngIf="isReady; else loading">
<div class="default-header">
<div class="row">
<h1 class="col">Roles Management</h1>
<h1 class="col">Roles</h1>
<button class="col" mat-raised-button color="primary" (click)="onDelete(selection.selected)" class="add-button"
[disabled]="selection.selected.length == 0">
Delete roles
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/template/template.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<mat-form-field (click)="$event.stopPropagation()" class="form-field" floatPlaceholder="never">
<input
matInput
placeholder="Search by name"
placeholder="Search template by name"
(keyup)="filterTemplates($event)"
[(ngModel)]="searchText"
[ngModelOptions]="{ standalone: true }"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[routerLink]="['/controller', controller.id, 'management', 'users']">
<mat-icon aria-label="Back to user management">keyboard_arrow_left</mat-icon>
</button>
<h1 class="col">User Details</h1>
<h1 class="col">User {{user.username}}</h1>
</div>
</div>
<div class="default-content">
Expand Down Expand Up @@ -81,7 +81,7 @@ <h1 class="col">User Details</h1>
</div>
</mat-tab>

<mat-tab label="Aces">
<mat-tab label="ACEs">
<div class="default-content">
<table mat-table [dataSource]="aceDatasource" class="mat-elevation-z8">

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="content" *ngIf="isReady; else loading">
<div class="default-header">
<div class="row">
<h1 class="col">User Management</h1>
<h1 class="col">Users</h1>
<button class="col" mat-raised-button color="primary" (click)="deleteMultiple()" class="add-button"
[disabled]="selection.selected.length == 0">
Delete Users
Expand Down

0 comments on commit 931b7b1

Please sign in to comment.