Activities of "hanntd"

Hi, I found the problem with LeptonManagment Feature:

  1. I have one Main application create by using Blazor Web App Template (v8.2) and some separated module created by using Module Template.
  2. When running module separately it created in db of related table such Feature, FeatureGroup... for LeptonManagment
  3. After Integrated my Modules to Main Application and applied Dynamic Permission I threw the error "Volo.Abp.AbpException: Undefined feature: LeptonManagement.Enable" so I must delete these information in db and run Main Applicaiton again it will run well and Dynamic Permission run well too.
  4. But if I dev on Module and run it for testing, debug... I will insert LeptonManagement again in Feature, FeatureGroup tables again. How can I prevent Modules insert LeptonManagement again?

Hi, I could run well with your code provided but I'm using the new Blazor Web App Template of v8.2 so I have changed as bellow:

  1. Create method to add Group and Permission in Application layer

  2. Create Interface in Contracts

  3. Create Controller in HttpApi

  4. Run application can create Permission Group and Permission in database

  5. Check Permission from User/Role didn't see Group and Permission added Method in Application: public async Task<Task> AddPermissionAsync(string groupName, string permissionName) { var group = await _permissionGroupRepository.GetListAsync();

         if (group.All(x => x.Name != groupName))
         {
             var permissionGroup = new PermissionGroupDefinitionRecord
             {
                 Name = groupName,
                 DisplayName = $"L:{groupName},Permission: {groupName}"
             };
             await _permissionGroupRepository.InsertAsync(permissionGroup);
    
             var permissions = await _permissionRepository.GetListAsync();
             if (permissions.All(x => x.Name != permissionName))
             {
                 var permission = new PermissionDefinitionRecord
                 {
                     Name = permissionName,
                     DisplayName = $"L:{permissionName},Permission: {permissionName}",
                     GroupName = groupName,
                     IsEnabled = true,
                     MultiTenancySide = MultiTenancySides.Both
                 };
                 await _permissionRepository.InsertAsync(permission);
    
                 await _distributedCache.RemoveAsync($"{_cacheOptions.KeyPrefix}_AbpInMemoryPermissionCacheStamp");
             }
         }
         else
         {
             var permissionGroup = group.FirstOrDefault(x => x.Name == groupName);
             var permissions = await _permissionRepository.GetListAsync();
             if (permissions.All(x => x.Name != permissionName))
             {
                 var permission = new PermissionDefinitionRecord
                 {
                     Name = permissionName,
                     DisplayName = $"L:{permissionName},Permission: {permissionName}",
                     GroupName = groupName,
                     IsEnabled = true,
                     MultiTenancySide = MultiTenancySides.Both
                 };
                 await _permissionRepository.InsertAsync(permission);
    
                 await _distributedCache.RemoveAsync($"{_cacheOptions.KeyPrefix}_AbpInMemoryPermissionCacheStamp");
             }
         }
         return Task.CompletedTask;
     }
    

If adding the following code in Blazor project it will threw the error, remove that code application run without error but cannot see created permission at runtime:

Thank you so much, if I'm using Blazor WebAssembly Application template I must implement this code in Application layer, right? Thanks

Thank you so much, I'll try it.

Thanks, I have checked but it's very difficult to me for getting a final solution based on that. Do you have a final code of that?

Thanks, I can change the footer as you guided.

I added your code and got other error, so I think I will wait for your patch of this version. In additional, I have another question, how can I change the footer info before login, I can custom MainFooterComponent.razor in Blazor.Client to change but this information only update after login and loading Blazor Web Assembly. Thanks

Thanks, I will try. Your code will be placed in Blazor.Client Module, right?

Hi, I have done as you recommended but another error happened, It is quite similar to issue of getting access token I asked you yesterday on another topic: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: Cannot provide a value for property 'AccessTokenProvider' on type 'Volo.Chat.Blazor.WebAssembly.Components.BlazorMessagesToolbarItem'. There is no registered service of type 'Microsoft.AspNetCore.Components.WebAssembly.Authentication.IAccessTokenProvider'. System.InvalidOperationException: Cannot provide a value for property 'AccessTokenProvider' on type 'Volo.Chat.Blazor.WebAssembly.Components.BlazorMessagesToolbarItem'. There is no registered service of type 'Microsoft.AspNetCore.Components.WebAssembly.Authentication.IAccessTokenProvider'. at Microsoft.AspNetCore.Components.ComponentFactory.<>c__DisplayClass9_0.<CreatePropertyInjector>g__Initialize|1(IServiceProvider serviceProvider, IComponent component) at Microsoft.AspNetCore.Components.ComponentFactory.PerformPropertyInjection(IServiceProvider serviceProvider, IComponent instance) at Microsoft.AspNetCore.Components.ComponentFactory.InstantiateComponent(IServiceProvider serviceProvider, Type componentType, IComponentRenderMode callerSpecifiedRenderMode, Nullable1 parentComponentId) at Microsoft.AspNetCore.Components.RenderTree.Renderer.InstantiateChildComponentOnFrame(RenderTreeFrame[] frames, Int32 frameIndex, Int32 parentComponentId) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewComponentFrame(DiffContext& diffContext, Int32 frameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewSubtree(DiffContext& diffContext, Int32 frameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange1 oldTree, ArrayRange`1 newTree) at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException) at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry) at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

I can use GetTokenAsync() of IAbpAccessTokenProvider in my module and now already resolved my issue. Thank you so much!

Showing 41 to 50 of 114 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on December 15, 2025, 06:08
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.