File

auth-configuration/sso-configuration/template-parts/access-mapping/access-mapping.component.ts

Metadata

Index

Properties
Methods
Inputs
Accessors

Constructor

constructor(controlContainer: ControlContainer)
Parameters :
Name Type Optional
controlContainer ControlContainer No

Inputs

apps
Type : IApplication[]
groups
Type : IUserGroup[]
inventoryRoles
Type : IIdentified[]
templateModel
Type : any

Methods

addAccessMapping
addAccessMapping()
Returns : void
addInventoryMapping
addInventoryMapping()
Returns : void
ngOnChanges
ngOnChanges()
Returns : void
onRemove
onRemove(accessMapping: AccessMapping)
Parameters :
Name Type Optional
accessMapping AccessMapping No
Returns : void
onRemoveInventoryMapping
onRemoveInventoryMapping(inventoryMapping: InventoryMapping)
Parameters :
Name Type Optional
inventoryMapping InventoryMapping No
Returns : void
setDynamicMappingConfiguration
setDynamicMappingConfiguration(mapRolesOnlyForNewUser: boolean, manageRolesOnlyFromAccessMapping)
Parameters :
Name Type Optional Default value
mapRolesOnlyForNewUser boolean No
manageRolesOnlyFromAccessMapping No false
Returns : void
setMapFromIdToken
setMapFromIdToken(mapFromIdToken)
Parameters :
Name Optional
mapFromIdToken No
Returns : void

Properties

CLEAR_AND_UPDATED_ROLES_ON_EACH_LOG_IN_OPTION
Default value : gettext( 'Roles selected in the rules below will be reassigned to a user on each log in and other ones will be cleared' )
CLEAR_AND_UPDATED_ROLES_ON_EACH_LOG_IN_TOOLTIP
Default value : gettext( 'The access mapping will be executed during the first login. The administrator cannot edit the SSO user roles. During the next login all the roles will be cleared and the mapping will be executed again.' )
RETRIVE_FROM_ACCESS_TOKEN
Default value : gettext('Retrieve from Access token')
RETRIVE_FROM_ID_TOKEN
Default value : gettext('Retrieve from ID token')
UPDATE_ROLES_LISTED_IN_ACCESS_MAPPING_ON_EACH_LOG_IN_OPTION
Default value : gettext( 'Roles selected in the rules below will be reassigned to a user on each log in and other ones will be unchanged' )
UPDATE_ROLES_LISTED_IN_ACCESS_MAPPING_ON_EACH_LOG_IN_TOOLTIP
Default value : gettext( 'The access mapping will be executed only once during the first login, then the administrator can edit the user roles. During the next login only the roles listed in the access mappings will be updated.' )
USE_ACCESS_MAPPING_ON_USER_CREATION_OPTION
Default value : gettext( 'Use dynamic access mapping only on user creation' )
USE_ACCESS_MAPPING_ON_USER_CREATION_TOOLTIP
Default value : gettext( 'The access mapping will be executed only once during the first login, then the administrator can edit the user roles. During the next login, these mappings will not be executed.' )

Accessors

mapRolesOnlyForNewUser
getmapRolesOnlyForNewUser()
manageRolesOnlyFromAccessMapping
getmanageRolesOnlyFromAccessMapping()
mapFromIdToken
getmapFromIdToken()
<div class="p-24">
  <div class="row">
    <div class="col-xs-12 col-sm-3 col-md-2">
      <div
        class="h4 text-normal text-right text-left-xs"
        translate
      >
        Access mapping
      </div>
    </div>

    <div class="col-xs-12 col-sm-9 col-md-10 col-lg-9">
      <fieldset class="c8y-fieldset p-24">
        <legend>{{ 'Source of dynamic access mapping' | translate }}</legend>
        <c8y-form-group>
          <label
            title="{{ RETRIVE_FROM_ACCESS_TOKEN | translate }}"
            class="c8y-radio input-sm"
          >
            <input
              type="radio"
              name="dynamicAccessMappingSource"
              [checked]="!mapFromIdToken"
              (change)="setMapFromIdToken(false)"
            />
            <span></span>
            <span>{{ RETRIVE_FROM_ACCESS_TOKEN | translate }}</span>
          </label>
          <label
            title="{{ RETRIVE_FROM_ID_TOKEN | translate }}"
            class="c8y-radio input-sm"
          >
            <input
              type="radio"
              name="dynamicAccessMappingSource"
              [checked]="mapFromIdToken"
              (change)="setMapFromIdToken(true)"
            />
            <span></span>
            <span>{{ RETRIVE_FROM_ID_TOKEN | translate }}</span>
          </label>
        </c8y-form-group>
      </fieldset>

      <fieldset class="c8y-fieldset p-24">
        <legend>{{ 'Dynamic access mapping principle' | translate }}</legend>
        <c8y-form-group>
          <label
            title="{{ USE_ACCESS_MAPPING_ON_USER_CREATION_OPTION | translate }}"
            class="c8y-radio input-sm"
          >
            <input
              type="radio"
              name="dynamicAccessMappingConfiguration"
              data-cy="c8y-inventory-roles-mapping--on-user-creation"
              [checked]="mapRolesOnlyForNewUser"
              (change)="setDynamicMappingConfiguration(true)"
            />
            <span></span>
            <span>{{ USE_ACCESS_MAPPING_ON_USER_CREATION_OPTION | translate }}</span>
            <button
              class="btn-help"
              type="button"
              [attr.aria-label]="'Help' | translate"
              popover="{{ USE_ACCESS_MAPPING_ON_USER_CREATION_TOOLTIP | translate }}"
              placement="right"
              triggers="focus"
              container="body"
            ></button>
          </label>
          <label
            title="{{ UPDATE_ROLES_LISTED_IN_ACCESS_MAPPING_ON_EACH_LOG_IN_OPTION | translate }}"
            class="c8y-radio input-sm"
          >
            <input
              type="radio"
              name="dynamicAccessMappingConfiguration"
              data-cy="c8y-inventory-roles-mapping--other-ones-will-be-unchanged"
              [checked]="!mapRolesOnlyForNewUser && manageRolesOnlyFromAccessMapping"
              (change)="setDynamicMappingConfiguration(false, true)"
            />
            <span></span>
            <span>
              {{ UPDATE_ROLES_LISTED_IN_ACCESS_MAPPING_ON_EACH_LOG_IN_OPTION | translate }}
            </span>
            <button
              type="button"
              class="btn-help"
              [attr.aria-label]="'Help' | translate"
              popover="{{ UPDATE_ROLES_LISTED_IN_ACCESS_MAPPING_ON_EACH_LOG_IN_TOOLTIP | translate }}"
              placement="right"
              triggers="focus"
              container="body"
            ></button>
          </label>
          <label
            title="{{ CLEAR_AND_UPDATED_ROLES_ON_EACH_LOG_IN_OPTION | translate }}"
            class="c8y-radio input-sm"
          >
            <input
              type="radio"
              name="dynamicAccessMappingConfiguration"
              data-cy="c8y-inventory-roles-mapping--other-ones-will-be-cleared"
              [checked]="!mapRolesOnlyForNewUser && !manageRolesOnlyFromAccessMapping"
              (change)="setDynamicMappingConfiguration(false, false)"
            />
            <span></span>
            <span>
              {{ CLEAR_AND_UPDATED_ROLES_ON_EACH_LOG_IN_OPTION | translate }}
            </span>
            <button
              class="btn-help"
              type="button"
              [attr.aria-label]="'Help' | translate"
              popover="{{ CLEAR_AND_UPDATED_ROLES_ON_EACH_LOG_IN_TOOLTIP | translate }}"
              placement="right"
              triggers="focus"
              container="body"
            ></button>
          </label>
        </c8y-form-group>
      </fieldset>
      <fieldset class="c8y-fieldset p-16">
        <legend>{{ 'Dynamic access mapping' | translate }}</legend>
        <c8y-ui-empty-state
          *ngIf="templateModel.onNewUser.dynamicMapping.mappings.length === 0"
          [icon]="'list'"
          [title]="'No access mapping rules defined.' | translate"
          [subtitle]="'Click below to add a new mapping.' | translate"
          [horizontal]="true"
        ></c8y-ui-empty-state>
        <div
          *ngFor="
            let accessMapping of templateModel.onNewUser.dynamicMapping.mappings;
            index as idx
          "
        >
          <c8y-sso-dynamic-access-mapping
            [accessMapping]="accessMapping"
            (onRemoveAccessMapping)="onRemove(accessMapping)"
            [apps]="apps"
            [groups]="groups"
            [accessMappingIndex]="idx"
          ></c8y-sso-dynamic-access-mapping>
        </div>
        <div class="p-t-16">
          <button
            id="add-access-mapping-button"
            class="btn btn-default"
            type="button"
            title="{{ 'Add access mapping' | translate }}"
            (click)="addAccessMapping()"
          >
            <i
              c8yIcon="plus-circle"
              class="m-r-4"
            ></i>
            {{ 'Add access mapping' | translate }}
          </button>
        </div>
      </fieldset>
      <fieldset class="c8y-fieldset p-16">
        <legend>
          {{ 'Inventory roles mapping' | translate }}
        </legend>
        <c8y-ui-empty-state
          *ngIf="templateModel.onNewUser.dynamicMapping.inventoryMappings.length === 0"
          [icon]="'list'"
          [title]="'No inventory roles mapping rules defined.' | translate"
          [subtitle]="'Click below to add a new mapping.' | translate"
          [horizontal]="true"
        ></c8y-ui-empty-state>
        <ng-container
          *ngFor="
            let inventoryMapping of templateModel.onNewUser.dynamicMapping.inventoryMappings;
            index as idx
          "
        >
          <c8y-sso-inventory-roles-mapping
            [inventoryRoles]="inventoryRoles"
            [inventoryMapping]="inventoryMapping"
            (onRemoveInventoryMapping)="onRemoveInventoryMapping(inventoryMapping)"
            [inventoryMappingIndex]="idx"
          ></c8y-sso-inventory-roles-mapping>
        </ng-container>
        <div class="p-t-16">
          <button
            id="add-inventory-mapping-button"
            class="btn btn-default"
            type="button"
            title="{{ 'Add inventory roles mapping' | translate }}"
            (click)="addInventoryMapping()"
          >
            <i
              c8yIcon="plus-circle"
              class="m-r-4"
            ></i>
            {{ 'Add inventory roles mapping' | translate }}
          </button>
        </div>
      </fieldset>
    </div>
  </div>
</div>

results matching ""

    No results matching ""