Open Closed

Remove one of the action contributors in Identity module (angular UI) #6383


User avatar
0
madklm_16 created

ABP Framework version:** v7.0.0

UI type: Angular

DB provider: EF Core

Tiered (MVC) or Identity Server Separated (Angular): yes

What is the best approach to remove the delete action from identity management Users Action List-


4 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    See: https://docs.abp.io/en/abp/latest/UI/Angular/Entity-Action-Extensions#how-to-place-a-custom-modal-and-trigger-it-by-entity-actions

    You can create an identityEntityActionContributor to remove the action:

    
    ....
    
    export function removeDeleteContributor(actionList: EntityActionList<IdentityUserDto>) {
      actionList.dropByValue('AbpIdentity::Delete', (value, searchedValue) => value.text === searchedValue);
    }
    
    export const identityEntityActionContributors: IdentityEntityActionContributors = {
      // enum indicates the page to add contributors to
      [eIdentityComponents.Users]: [
        removeDeleteContributor,
        // You can add more contributors here
      ],
    };
    
    ....
    
    // src/app/app-routing.module.ts
    
    // other imports
    import { identityEntityActionContributors } from './entity-action-contributors';
    
    const routes: Routes = [
      // other routes
    
      {
        path: 'identity',
        loadChildren: () =>
          import('@volo/abp.ng.identity').then(m =>
            m.IdentityModule.forLazy({
              entityActionContributors: identityEntityActionContributors,
            })
          ),
      },
    
      // other routes
    ];
    
  • User Avatar
    0
    mahmut.gundogdu created

    custom contributor is a solition but I would remove the permission of the users. After that the user can't see and use.

  • User Avatar
    0
    madklm_16 created

    Is there way to do it programmatically ?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Will this can help for you? https://support.abp.io/QA/Questions/6383#answer-3a0f9c51-4061-c15b-3343-1258a319af48

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11