//- Copyright (c) 2019 AT&T Intellectual Property. # //- # //- Licensed under the Apache License, Version 2.0 (the "License"); # //- you may not use this file except in compliance with the License. # //- You may obtain a copy of the License at # //- # //- http://www.apache.org/licenses/LICENSE-2.0 # //- # //- Unless required by applicable law or agreed to in writing, software # //- distributed under the License is distributed on an "AS IS" BASIS, # //- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # //- See the License for the specific language governing permissions and # //- limitations under the License. # //- ############################################################################# div([@routerTransition]) .card-md-12 .pull-left app-page-header([heading]="'Custom Role Management'") h5 {{ groupName }} .pull-right button(mat-raised-button color="primary", (click)="update()") Update All Rows .card-md-12.mt-3 div(style="width: 100%", [hidden]="!loading") mat-spinner(style="margin: auto", color="primary") table(mat-table, [dataSource]="dataSource", style="width: 100%", [hidden]="loading") ng-container(matColumnDef="roleName") th(mat-header-cell, *matHeaderCellDef) Role Name td(mat-cell, *matCellDef="let element") {{ element.roleName }} ng-container(matColumnDef="read") th(mat-header-cell, *matHeaderCellDef) Read td(mat-cell, *matCellDef="let element") mat-checkbox([(ngModel)]="element.readPermission", [disabled]="true") ng-container(matColumnDef="write") th(mat-header-cell, *matHeaderCellDef) Write td(mat-cell, *matCellDef="let element") mat-checkbox([(ngModel)]="element.writePermission", [disabled]="(element.roleName == 'admin')") ng-container(matColumnDef="execute") th(mat-header-cell, *matHeaderCellDef) Execute td(mat-cell, *matCellDef="let element") mat-checkbox([(ngModel)]="element.executePermission", [disabled]="(element.roleName == 'admin')") ng-container(matColumnDef="delete") th(mat-header-cell, *matHeaderCellDef) Delete td(mat-cell, *matCellDef="let element") mat-checkbox([(ngModel)]="element.deletePermission", [disabled]="(element.roleName == 'admin')") ng-container(matColumnDef="management") th(mat-header-cell, *matHeaderCellDef) Management td(mat-cell, *matCellDef="let element") mat-checkbox([(ngModel)]="element.managementPermission", [disabled]="true") ng-container(matColumnDef="actions") th(mat-header-cell, *matHeaderCellDef) Actions td(mat-cell, *matCellDef="let element") button(color="warn", matTooltip="Delete Role Permissions", mat-icon-button, (click)="deleteRole(element)", [disabled]="((element.roleName == 'admin') || (element.roleName == 'user') || (element.roleName == 'developer'))") mat-icon delete_forever button(color="primary", matTooltip="Save Role Permissions", mat-icon-button, (click)="update()", [disabled]="(element.roleName == 'admin')") mat-icon save tr(mat-header-row *matHeaderRowDef="displayedColumns") tr(mat-row *matRowDef="let row; columns: displayedColumns;") div(style="width: 100%;height:50px") .card-md-12 .row .col-sm-4 h3 Add New Role .row .col-sm-4 mat-form-field input(matInput [(ngModel)]="roleName", id="roleName", name="roleName", placeholder="Role Name", required) button(mat-raised-button color="primary", (click)="create()", style="margin-left:20px;", [disabled]="!roleName") Add Role