Base solution for your next web application
Open Closed

Collecting Permissions through an App #10650


User avatar
0
Hostmaster created

Hi,

We've found the need recently to write a couple of services and a native Android ap to hook into AspNet Zero. Essentially we've replicated the Tenant and Login facilities in order to handle some things in the background.

One of the things we need access to, is the granted permissions for the user. The angular implementation appears to be very obscured with a very simple:

abp.auth.grantedPermissions = abp.auth.grantedPermissions || {},

Is there an API call we can do to get a list of granted permissions for the user?

Don't worry about the implementation, all I need to do is find how to call it. And what format the data is in. But I can work that out.

Thanks Simon


2 Answer(s)
  • User Avatar
    0
    musa.demir created

    Hi @hostmaster

    Angular loads permission from AbpUserConfiguration/GetAll request. You can also use it.

    (Here is the implementation: https://github.com/aspnetboilerplate/aspnetboilerplate/blob/8ea8b211468d2e8242510424fb87813d196f59a1/src/Abp.Web.Common/Web/Configuration/AbpUserConfigurationBuilder.cs#L188-L210)

  • User Avatar
    0
    Hostmaster created

    Works like a charm, thank you. Though in this case, we need to look at grantedPermissions.