Base solution for your next web application
Open Closed

Dynamic Permissions #12248


User avatar
0
gjubber created

Hi,

Hope you are well.

We want to implement dynamic permissions within our application and I wanted to find out if this is possible and/or if you can share any resources of how one could achieve this?

The scenario:

When adding a specific entity (eg. Category), we want to dynamically create a permission associated with this specific entity.

With a "normal" implementation, we would create the entity and "manually" create permissions for CRUD operations of the entity in the AppAuthorizationProvider. However, we want to give the users the ability to create/update/delete their own "categories", but we still want to associate permissions with that "category" in order to manage who will be able to use that "category".

I have found the following blog posts, but the examples mentioned is not 100% clear:

  • https://support.aspnetzero.com/QA/Questions/12245/Dynamic-Permission
  • https://support.aspnetzero.com/QA/Questions/12214/Add-a-new-permission-from-the-database-in-SetPermissions-method-in-the-AppAuthorizationProvidercs
  • https://support.aspnetzero.com/QA/Questions/11619/ChangeAddRemove-Role-Permission-Tree-Root-Menu-Item-Dynamically

Any assistence with regards to this question is much appreciated.

Kind regards, Robert


9 Answer(s)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi

    We are planning to create a blog post about dynamic permissions. Please stay tuned.

  • User Avatar
    0
    gjubber created

    Hi,

    Thank you.

  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi

    You can follow blog post issues regarding Dynamic Permissions here. We will announce it to you when it is published, stay tuned.

  • User Avatar
    0
    gjubber created

    Hi,

    Thank you for the feedback! However, I receive a 404 if I navigate to the link. I assume it is not live yet?

    Kind regards, Robert

  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi

    After logging in with the user who has the plan on the aspnetzero.com website, clicking the manage button under the Account button, you can give permission to the github user you are trying to log in from the Github Members tab on the relevant page.

  • User Avatar
    0
    gjubber created

    Hi,

    Ah, lovely user error.

    Thank you for the clarification, I can see the page now.

    Kind regards, Robert

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks @gjubber

    We are planning to publish the blog post in a few days.

  • User Avatar
    0
    [email protected] created

    Thanks @gjubber

    We are planning to publish the blog post in a few days.

    any Update please?

  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi

    Dynamic Permissions blog post merged will soon be published on the ASP.NET Zero website. You can review the blog post created from the pull request here.