Activities of "mattw@agilenova.com"

Answer

Hi, I just tried calling the application-configuration endpoint from postman before and after a role change, but the auth / grantedPolicies are not changing. I'm running ABP 8.0.2 commercial.

"auth": { "grantedPolicies": { }

If I restart HttpApi.Host, the grantedPolicies are updated.

I followed the instructions to upgrade my code in XXXHttpApiHostModule.cs: private void ConfigureAuthentication(ServiceConfigurationContext context) { context.Services.ForwardIdentityAuthenticationForBearer(OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme); // Enable dynamic claims context.Services.Configure<AbpClaimsPrincipalFactoryOptions>(options => { options.IsDynamicClaimsEnabled = true; //options.RemoteRefreshUrl = configuration["AuthServerUrl"] + options.RemoteRefreshUrl; }); }

... app.UseUnitOfWork(); app.UseDynamicClaims(); app.UseAuthorization();

Please advise.

Answer

Hello,

I second the request for a working example for Dynamic Claims. I have followed the instructions to enable dynamic claims in HttpApi.Host, but am at a loss as to how to get this to work in the Angular front end.

In my case, the ABP backend (with the embedded OpenIddict auth server) changes the user's role based on payment for a subscription. The issue is that the ABP front-end, which uses Angular, has a JWT token with the old role and the token doesn't reflect the change until I logout and log back in. The documentation indicates that the user role is a dynamic claim but I am not sure how this works.

Please provide an example or additional documentation on how Dynamic Claims can be enabled with an Angular front end.

Thank you!

That worked perfectly! Thanks

This is exactly what I needed. Thank you!

Hello Anjali,

Yes, I checked that link but it does not describe the use of the Angular module or any Angular related configuration or guidelines.

I am using ABP Angular, not MVC, and was happy to find the @volo/abp.ng.payment feature extension but could not find any documentation on how to configure it. Please provide any related documentation or guidelines.

Thank you, Matt

I wasn't sure how to resolve the issue (above) in 7.1.1 and upgraded the project to ABP 7.2.1. Angular UI generation is working in ABP 7.2.1 so far.

Regarding the substeps, I had simply selected all generation options (check boxes) on the Entity Info screen.

After looking further into the ABP suite logs more carefully, I found this error: 2023-05-05 08:55:32.276 -04:00 [INF] Angular Schematics command failed. file:///Users/xxx/yyy/angular/.suite/schematics/run-schematics.mjs:1 import { execa } from "execa"; ^^^^^ SyntaxError: Named export 'execa' not found. The requested module 'execa' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using:

import pkg from 'execa'; const { execa } = pkg;

at ModuleJob._instantiate (node:internal/modules/esm/module_job:127:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:193:5)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:337:24)
at async loadESM (node:internal/process/esm_loader:88:5)
at async handleMainPromise (node:internal/modules/run_main:61:12)

Due to the restriction above, I am trying to add a Language (extra) property to the CMS Page object. Please confirm the steps:

  1. I added the extra property in the AppDomainModule: ObjectExtensionManager.Instance .AddOrUpdate<Page>(options => { options.AddOrUpdateProperty<string>("Language", options => { options.DefaultValue = "en"; }); } );
  2. I mapped the property to a column in AppEfCoreEntityExtensionMappings ObjectExtensionManager.Instance .AddOrUpdateProperty<Page, string>( "Language", options => { options.MapEfCore(b => b.HasMaxLength(10)); } );
  3. I created and ran the migration successfully to add the Language column to the CmsPage table
  4. I copied the Razor / Admin pages from the CmsKit source code (retrieved using get-source) and copied into my Web project's Pages/CmsKit/Pages folder and renamed the model classes and updated the @model to reference the new class names
  5. I customized the .cshtml views to include the new Language field.

How do I update the services and DTOs to return the updated Page/PageDto with the new field? I was thinking of trying CreateMap<Page, PageDto>().MapExtraProperties(); but I get a compile time error: The type 'Volo.CmsKit.Admin.Pages.PageDto' must be convertible to 'Volo.Abp.Data.IHasExtraProperties' in order to use it as parameter

Please advise on next steps to allow CmsKit to support an extra property in the Page object. Thanks!

Hello,

The module must be developed with the Module Entity Extensions system in mind. All the official modules support this system wherever possible. more

Also, you can generate a YourModuleExtensionConfiguration by inheriting from ModuleExtensionConfiguration.

There is no direct method for CmsKitModule.
It requires the type ModuleExtensionConfiguration for the action. You're right.

Regards

Hello,

I have a similar requirement. I wish to extend the CmsKitModule by adding extra properties. Is adding the Module Extension Configuration in the product roadmap for a future release (and, if so, when)?

Thanks

I found the issue. I had to manually assign the OpenId permission to the admin user in order to see the menu option.

Showing 11 to 20 of 25 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11