Ends in:
3 DAYS
15 HRS
7 MIN
44 SEC
Ends in:
3 D
15 H
7 M
44 S

Activities of "hiltond"

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:

  • I ran the db migrator against a fresh database.
  • Commented out redis config stuff in the host modules that use it because I don't have a local redis cache.
    //context.Services.AddStackExchangeRedisCache(options =>
    //{
    //    options.Configuration = configuration["Redis:Configuration"];
    //});
  • I added the Devices page in the web project to reference the remote API in the same way as my initial post. This included referencing the same assemblies and adding typeof(DevicesHttpApiClientModule), typeof(AbpHttpClientIdentityModelModule) as dependency references in the WebModule.cs file.
  • I ran the sites and went into the User Management to give permissions for the remote API permission set like I did in the non-tiered project, but I don't see the permission set in there, it seems to be missing and I'm not sure why. Is there some other place I need to add a reference or something in the tiered web project that I didn't have to in the non-tiered one to show these permissions?

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" |

Showing 11 to 14 of 14 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on December 02, 2024, 12:35