Base solution for your next web application
Open Closed

how to extend abp.auth.hasPermission #7897


User avatar
0
fupanda created

There is a javascript helper to check the permissions in javascript, however I want to extend this functionality with an extra parameter. I already have my own PermissionChecker and done an override of the IsGranted class in mvc razor views, this work fine, but can't figure out how the abp.auth.hasPermission exactly works and how to extend this.


2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    The principle of front-end checking permissions is: First get all the permissions of the application and the permissions granted by the current user from the server. Retrieve this information every time the page is refreshed (/AbpScripts/GetScripts)

    The permission check in abp.js is just a simple judgment.

    https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.Web.Resources/Abp/Framework/scripts/abp.js#L127

  • User Avatar
    0
    fupanda created

    Thank you for the quick response. It's totally clear now. However, this won't solve my problem as our application has 'project' specific roles and rights. Need to check if a teammember of a project has rights to specific functionalities. This seems not possible in this way. I think I have to solve this on the razor page