@if (role) {
  <h4 mat-dialog-title><ng-container i18n="Manage role dialog title">Manage role</ng-container>&nbsp;-&nbsp;{{role.key}}</h4>
}

@if (role) {
  <mat-dialog-content>
    @for (permission of available_permissions; track permission) {
      <div>
        <div matListItemTitle>{{permissionToLabel[permission] ? permissionToLabel[permission] : permission}}</div>
        <div matListItemLine>
          <mat-radio-group [disabled]="permission === 'settings' && role.key === 'admin'" (change)="changeRolePermissions($event, permission)" [(ngModel)]="permissions[permission]" [attr.aria-label]="'Give role permission for ' + permission">
            <mat-radio-button value="yes"><ng-container i18n="Yes">Yes</ng-container></mat-radio-button>
            <mat-radio-button value="no"><ng-container i18n="No">No</ng-container></mat-radio-button>
          </mat-radio-group>
        </div>
      </div>
    }
  </mat-dialog-content>
}

<mat-dialog-actions>
  <button mat-button mat-dialog-close><ng-container i18n="Close">Close</ng-container></button>
</mat-dialog-actions>