In the Remote API solution (which is a module template solution) in Application.Contracts I have two files in an Authorization folder: DevicesPermissionDefinitionProvider
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
namespace NowMicro.Dice.Devices.Authorization
{
public class DevicesPermissionDefinitionProvider : PermissionDefinitionProvider
{
public override void Define(IPermissionDefinitionContext context)
{
var devicesGroup = context.AddGroup(DevicesPermissions.GroupName);
var products = devicesGroup.AddPermission(DevicesPermissions.Devices.Default);
products.AddChild(DevicesPermissions.Devices.Update);
products.AddChild(DevicesPermissions.Devices.Delete);
products.AddChild(DevicesPermissions.Devices.Create);
}
}
}
DevicesPermissions
using Volo.Abp.Reflection;
namespace NowMicro.Dice.Devices.Authorization
{
public class DevicesPermissions
{
public const string GroupName = "Devices";
public static class Devices
{
public const string Default = GroupName + ".Device";
public const string Delete = Default + ".Delete";
public const string Update = Default + ".Update";
public const string Create = Default + ".Create";
}
public static string[] GetAll()
{
return ReflectionHelper.GetPublicConstantsRecursively(typeof(DevicesPermissions));
}
}
}
As suggested earlier, I created a tiered version of the web project: MVC, no mobile, EF Core, and tiered. Steps I took after that:
//context.Services.AddStackExchangeRedisCache(options =>
//{
// options.Configuration = configuration["Redis:Configuration"];
//});
typeof(DevicesHttpApiClientModule), typeof(AbpHttpClientIdentityModelModule)
as dependency references in the WebModule.cs file.I've setup a tiered version of the web project, but I'm running into a problem getting the permissions for the remote API to show up. When I go to add the permissions to the admin user I don't see any for the remote API permission set I created. I have references for typeof(DevicesHttpApiClientModule), typeof(AbpHttpClientIdentityModelModule)
in the Web module. Am I missing something in the tiered version that wasn't required in the non-tiered one?
Thanks for getting back, here is what I see:
| Name | Value | | --- | --- | | Email | "admin@abp.io" | | EmailVerified | false | | Id | {5a86407f-aa6f-3eab-147a-39f4f7773384} | | IsAuthenticated | true | | PhoneNumber | null | | PhoneNumberVerified | false | | Roles | {string[1]} | | TenantId | null | | UserName | "admin" |
Then when I expand Roles I see:
| Name | Value | | --- | --- | | [0] | "admin" |