Open Closed

identity management permissions #4841


User avatar
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: NA
  • Steps to reproduce the issue:"NA

We have to enable below permission for role but don't want menu (administration --> identity management --> users) to be displayed in web UI. How we can achieve it. Identity management --> user management --> create/Edit permission

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

10 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    Sorry, but can you explant it in detail? thanks

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    shobhit created
    1. When below permission provided (we wants only Edit Permission)
    2. In UI Following menu section displayed
    3. What we want: Only Edit permission should be enabled so that menu is not visible
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    You can the following code to your MenuContributor

    var identity = context.Menu.GetAdministration().GetMenuItem(IdentityMenuNames.GroupName);
    identity.GetMenuItem(IdentityMenuNames.Users).RequirePermissions(IdentityPermissions.Users.Delete, IdentityPermissions.Users.Create);
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    shobhit created

    Do i have to modify this class or i am looking at wrong place.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    shobhit created

    If this is the righ place to modify code i am getting error in

    identity.GetMenuItem("Users").RequirePermissions(IdentityPermissions.Users.Delete, IdentityPermissions.Users.Create);

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    Sorry, I just realized you are using angular UI.

    You can check the document to patch a menu: https://docs.abp.io/en/abp/4.2/UI/Angular/Modifying-the-Menu#how-to-patch-or-remove-a-navigation-element

    const newIdentityUserRouteConfig: Partial<ABP.Route> = {
      parentName: eIdentityRouteNames.IdentityManagement,
      requiredPolicy: 'permission key here',
    };
    
    this.routes.patch(eIdentityRouteNames.Users, newIdentityUserRouteConfig);
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    shobhit created

    How we can add multiple policies. is it comma seperated and will it consider "and" or "or" condition for permissions?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    How we can add multiple policies. is it comma seperated and will it consider "and" or "or" condition for permissions?

    Unfortunately not.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    shobhit created

    Oh Ok. So it will consider only 1 policy?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    The route has a property invisible, you can check the permissions manually.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 23, 2026, 09:57
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.