question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom Permissions

See original GitHub issue

I have a requirement to extend roles to hierarchical entities such that we may grant a user a role for a specific entity. Because there are no facilities to do this in vanilla ABP, I’ve copied a lot of the role and OU system from ABP and customized it. My entities are called Portfolios and new roles are called PortfolioRoles. This is working well – I am able to grant my PortfolioRole an ABP Permission, give a User the PortfolioRole, and authorize them on that role using [AbpAuthoize].

However I have a need to differentiate permissions that are grantable to the two roles (Role and PortfolioRole). Right now both roles use the same permission entities, and I am unable to determine which permissions are allowed to be granted to which role. This means I can grant my PortfolioRoles permissions which were intended just for regular ABP Roles and vice versa.

It seems that the root of the issue is that AuthorizationProvider.SetPermissions() can only accept IPermissionDefinitionContext, which prevents me from declaring a new permission and giving it to the ABP authorization system.

Do you have any suggestions for implementing custom permissions for an AuthorizationProvider, or another way I could discriminate between two different types of permissions? The best solution I have currently is a naming convention for permissions, but I’d prefer something a little more concrete than that. I am using ABP 1.4.0 and Zero 1.4.0. Thanks, and great framework!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
hikalkancommented, Mar 16, 2017

I mean we can accept PR for that 😃

0reactions
ismcagdascommented, Jul 1, 2019

@Imbasaur you are right, this needs extra work to do.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create Custom Permissions
Create custom permissions to give users access to custom processes or apps. Required Editions and User Permissions. Available in: both Salesforce Classic (not ......
Read more >
Step By Step Guide to Custom Permission in Salesforce
Custom Permissions in Salesforce are used to give access to users for certain apps or processes that you have configured and which cannot...
Read more >
Custom Permissions in Salesforce
Custom permission is one of the Salesforce features to grant user access to custom processes or apps. Requirement: Once a record is approved...
Read more >
Custom Permissions in Salesforce - YouTube
Salesforce Latest scenario-based Interview Questions : Custom Permissions in Salesforce Subscription link: ...
Read more >
Custom permission in salesforce -- Use Case - YouTube
In this video, we'll show you how to create custom permission in salesforce ... create custom permissions for users in your salesforce account....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found