2 ============LICENSE_START==========================================
4 ===================================================================
5 Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 ===================================================================
8 Unless otherwise specified, all software contained herein is licensed
9 under the Apache License, Version 2.0 (the "License");
10 you may not use this software except in compliance with the License.
11 You may obtain a copy of the License at
13 http://www.apache.org/licenses/LICENSE-2.0
15 Unless required by applicable law or agreed to in writing, software
16 distributed under the License is distributed on an "AS IS" BASIS,
17 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 See the License for the specific language governing permissions and
19 limitations under the License.
21 Unless otherwise specified, all documentation contained herein is licensed
22 under the Creative Commons License, Attribution 4.0 Intl. (the "License");
23 you may not use this documentation except in compliance with the License.
24 You may obtain a copy of the License at
26 https://creativecommons.org/licenses/by/4.0/
28 Unless required by applicable law or agreed to in writing, documentation
29 distributed under the License is distributed on an "AS IS" BASIS,
30 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 See the License for the specific language governing permissions and
32 limitations under the License.
34 ============LICENSE_END============================================
39 <div class="container">
40 <div class="onap-main-view-title">
41 <h1 class="heading-page">Roles</h1>
44 <mat-label> Select Application </mat-label>
45 <mat-select [disabled]='centralizedApps.length === 0' [(ngModel)]="selectedCentralizedApp">
46 <mat-option *ngFor="let app of centralizedApps" [value]="app.appId"
47 (click)="getRolesForSelectedCentralizedApp(selectedCentralizedApp)">
48 {{app.appName}}</mat-option>
52 <button type="button" class="btn btn-primary" [disabled]='centralizedApps.length === 0'
53 (click)="openBulkUploadRolesAndFunctionsModal()"><i class="icon ion-md-cloud-upload"></i>
55 <button type="button" class="btn btn-primary" [disabled]='centralizedApps.length === 0' [hidden]="!syncRolesApplied"
56 (click)="syncRolesFromExternalAuthSystem()"><i class="icon ion-md-sync"></i>
58 <button type="button" class="btn btn-primary" [disabled]='centralizedApps.length === 0'
59 (click)="addRoleModalPopup()"><i class="icon ion-md-add-circle-outline"></i>
61 <span class="onap-spinner" *ngIf="showSpinner"></span>
62 <table mat-table [dataSource]="roleDataSource" matSort>
64 <ng-container matColumnDef="name">
65 <th id="col1" mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>
66 <td id="rowheader_t1_{{i}}-firstName" mat-cell *matCellDef="let element; let i = index;"> {{element.name}}
70 <!-- Priority Column -->
71 <ng-container matColumnDef="priority">
72 <th id="col2" mat-header-cell *matHeaderCellDef mat-sort-header> Priority </th>
73 <td id="rowheader_t1_{{i}}-lastName" mat-cell *matCellDef="let element; let i=index;"> {{element.priority}}
77 <!-- Active Column -->
78 <ng-container matColumnDef="active">
79 <th id="col3" mat-header-cell *matHeaderCellDef mat-sort-header> Active </th>
80 <td id="rowheader_t1_{{i}}-userId" mat-cell *matCellDef="let element; let i=index;">
82 [disabled]="(element.id === 1 || element.id === 999) || ((this.selectedCentralizedApp !== 1) && (element.name.indexOf('global_') !== -1))"
83 [(ngModel)]="element.active" (change)="toggleRole(element)"></mat-slide-toggle>
88 <ng-container matColumnDef="edit">
89 <th id="col3" mat-header-cell *matHeaderCellDef mat-sort-header> Edit </th>
90 <td id="rowheader_t1_{{i}}-userId" mat-cell *matCellDef="let element; let i=index;">
91 <span class="icon-trash" id="{{i}}-button-edit" (click)="editRoleModalPopup(element)">
92 <i class="icon ion-md-create"></i>
97 <!-- Delete Column -->
98 <ng-container matColumnDef="delete">
99 <th [hidden]="selectedCentralizedApp === 1" id="col4" mat-header-cell *matHeaderCellDef> Delete </th>
100 <td [hidden]="selectedCentralizedApp === 1" id="rowheader_t1_{{i}}-applications" mat-cell
101 *matCellDef="let element; let i=index;">
102 <span class="icon-trash" id="{{i}}-button-portal-admin-remove" (click)="removeRole(element)">
103 <i class="icon ion-md-trash"></i>
108 <tr [hidden]="availableRoles.length === 0" mat-header-row *matHeaderRowDef="displayedColumns"></tr>
109 <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
111 <mat-paginator [hidden]="availableRoles.length === 0" [pageSizeOptions]="[10, 20]" showFirstLastButtons>
113 <a id="manage-role" [hidden]="availableRoles.length === 0" [routerLink]="['/roleFunctions']">Manage Role
114 Functions</a><br><br>