mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-03-29 06:25:58 +00:00
Merge pull request #1465 from GNS3/rbac-tweaking
Adjustments for RBAC system
This commit is contained in:
commit
931b7b1109
@ -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 = [
|
||||
{
|
||||
@ -249,12 +249,12 @@ const routes: Routes = [
|
||||
component: RoleManagementComponent
|
||||
},
|
||||
{
|
||||
path: "resourcePools",
|
||||
path: "pools",
|
||||
component: ResourcePoolsManagementComponent
|
||||
},
|
||||
{
|
||||
path: 'aces',
|
||||
component: AceManagementComponent
|
||||
path: 'ACL',
|
||||
component: AclManagementComponent
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -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';
|
||||
@ -547,7 +547,7 @@ import { DeleteResourceConfirmationDialogComponent } from './components/resource
|
||||
NodesMenuConfirmationDialogComponent,
|
||||
ConfirmationDeleteAllProjectsComponent,
|
||||
ProjectMapLockConfirmationDialogComponent,
|
||||
AceManagementComponent,
|
||||
AclManagementComponent,
|
||||
AddAceDialogComponent,
|
||||
AutocompleteComponent,
|
||||
DeleteAceDialogComponent,
|
||||
|
@ -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>
|
@ -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();
|
||||
});
|
@ -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>;
|
@ -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 = {
|
@ -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";
|
||||
|
||||
|
||||
|
@ -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">
|
||||
@ -56,7 +56,7 @@
|
||||
[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">
|
||||
|
||||
|
@ -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>
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
<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>
|
||||
|
||||
|
@ -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(
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<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>
|
||||
|
||||
|
@ -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>
|
||||
@ -23,7 +23,7 @@
|
||||
<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>
|
||||
|
@ -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
|
||||
@ -7,16 +7,16 @@
|
||||
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>
|
||||
@ -24,7 +24,7 @@
|
||||
<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>
|
||||
|
||||
|
@ -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
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
<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>
|
||||
|
@ -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">
|
||||
|
@ -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
|
||||
|
@ -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 }"
|
||||
|
@ -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">
|
||||
@ -81,7 +81,7 @@
|
||||
</div>
|
||||
</mat-tab>
|
||||
|
||||
<mat-tab label="Aces">
|
||||
<mat-tab label="ACEs">
|
||||
<div class="default-content">
|
||||
<table mat-table [dataSource]="aceDatasource" class="mat-elevation-z8">
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user