Open Closed

Enable Action --> Options #3812


0
shobhit created
  • ABP Framework version: v4.2.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes /
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

How We can enable/disable action list for Administration --> Identity Management --> Users


2 Answer(s)
  • 0
    shobhit created

    In the above example we have to hide "Claims" action

  • 0
    mahmut.gundogdu created
    Support Team

    The identity module has extensible system feature. So you can override entity_actions.

    import { EntityAction, EntityActionList } from '@abp/ng.theme.shared/extensions';
    import { IdentityEntityActionContributors, UsersComponent } from '@volo/abp.ng.identity';
    import { IdentityUserDto } from '@volo/abp.ng.identity/proxy';
    
    const claimsModal = new EntityAction<IdentityUserDto>({
      text: 'AbpIdentity::Claims',
      action: data => {
        const component = data.getInjected(UsersComponent);
        component.openPermissionsModal(data.record.id, data.record.userName);
      },
      permission: 'MyCustomPermissionToken',
      visible: data => true // implement your custom logic
    });
    
    export function claimsModalContributor(actionList: EntityActionList<IdentityUserDto>) {
      const index = actionList.indexOf(
        'AbpIdentity::Claims',
        (action, text) => action.text === text,
      );
      actionList.dropByIndex(index);
      actionList.addByIndex(claimsModal, index);
    }
    
    export const identityEntityActionContributors: IdentityEntityActionContributors = {
      'Identity.UsersComponent': [claimsModalContributor],
    };
    
    

    See the detail. https://docs.abp.io/en/abp/latest/UI/Angular/Dynamic-Form-Extensions