permissions.component.html raw

   1  <div class="header-pane">
   2    <lib-icon-button
   3      icon="chevron-left"
   4      (click)="navigateBack()"
   5    ></lib-icon-button>
   6    <span>Permissions</span>
   7  </div>
   8  
   9  @if(hostsPermissions.length === 0) {
  10  <span class="text-muted" style="font-size: 12px">
  11    Nothing configured so far.
  12  </span>
  13  } @else {
  14  <button class="btn btn-danger btn-sm remove-all-btn" (click)="onClickRemoveAllPermissions()">
  15    Remove All Permissions
  16  </button>
  17  }
  18  @for(hostPermissions of hostsPermissions; track hostPermissions) {
  19  <div class="permissions-card">
  20    <span style="margin-bottom: 4px; font-weight: 500">
  21      {{ hostPermissions.host }}
  22    </span>
  23  
  24    @for(permission of hostPermissions.permissions; track permission) {
  25    <div class="permission">
  26      <span
  27        [class.action-allow]="permission.methodPolicy === 'allow'"
  28        [class.action-deny]="permission.methodPolicy === 'deny'"
  29        >{{ permission.methodPolicy }}</span
  30      >
  31      <span class="text-muted">{{ permission.method }}</span>
  32      @if(typeof permission.kind !== 'undefined') {
  33      <span [title]="getKindTooltip(permission.kind!)">(kind {{ permission.kind }})</span>
  34      }
  35      <div class="sam-flex-grow"></div>
  36      <lib-icon-button
  37        icon="trash"
  38        title="Revoke permission"
  39        (click)="onClickRevokePermission(permission)"
  40      ></lib-icon-button>
  41    </div>
  42    }
  43  </div>
  44  
  45  }
  46