Hi everyone,
I'm working on a new ASP.NET Core application and need to implement a more granular authorization system. I've successfully integrated .NET Core Identity for user management, but I'm struggling with how to best manage custom claims and roles that go beyond the standard ones.
Specifically, I want to:
- Add custom claims like "Department" and "ProjectAccessLevel" to users.
- Create custom roles that might combine specific permissions (e.g., "ProjectManager_ProjectA").
- Efficiently check for these custom claims and roles in my controllers and Razor Pages.
I've looked into AddClaimsAsync
and creating custom role types, but I'm not sure about the best practices for storing and querying this data, especially for performance.
Any guidance, code examples, or links to good resources would be greatly appreciated!
Thanks in advance!