Comments (16)
We'll work on creating a project that highlights the issue
from eshoponabp.
Hello,
While debugging the ABP code, we've discovered that when the cache is cleared or a role is assigned to a user from the X service, the admin service isn't affected. However, when we clear the cache from the admin service, everything works fine.
Please refer to this video for a clearer understanding of the issue: Video Link
Additionally, we've created a project for your review to investigate the problem: Project Link
Please note the changes we've made in the latest version of eShop code:
-
Permission creation from CmskitService: Code Link
-
Dynamic permission enablement in AdministrationService: Code Link
Your assistance in resolving this matter is greatly appreciated.
Thank you!
from eshoponabp.
hi
You can inject the IDistributedCache DistributedCache
and remove the $"{CacheOptions.KeyPrefix}_AbpInMemoryPermissionCacheStamp";
cache.
I will find a way on the framework.
from eshoponabp.
Ok, I tried this, and the cache cleared successfully.
However, I encountered another issue when attempting to call this function from X service:
await _permissionManager.SetForRoleAsync("admin", name, true);
We've discovered that we should also enable the IsDynamicPermissionStoreEnabled configuration in the X service when we activate it. We're encountering the following exceptions within the PermissionManager
ManagementProviders
(Autofac.Core.DependencyResolutionException: An exception was thrown while activating Volo.Abp.PermissionManagement.Identity.RolePermissionManagementProvider. ---> Autofac.Core.DependencyResolutionException: None of the constructors found on type 'Volo.A…):
[humanresource-service_3e0ba3d1-e]: [13:39:17 WRN] An exception occurred, but response has already started!
[humanresource-service_3e0ba3d1-e]: [13:39:17 ERR] An unhandled exception has occurred while executing the request.
[humanresource-service_3e0ba3d1-e]: Autofac.Core.DependencyResolutionException: An exception was thrown while activating Volo.Abp.PermissionManagement.Identity.RolePermissionManagementProvider.
[humanresource-service_3e0ba3d1-e]: ---> Autofac.Core.DependencyResolutionException: None of the constructors found on type 'Volo.Abp.PermissionManagement.Identity.RolePermissionManagementProvider' can be invoked with the available services and parameters:
[humanresource-service_3e0ba3d1-e]: Cannot resolve parameter 'Volo.Abp.Identity.IUserRoleFinder userRoleFinder' of constructor 'Void .ctor(Volo.Abp.PermissionManagement.IPermissionGrantRepository, Volo.Abp.Guids.IGuidGenerator, Volo.Abp.MultiTenancy.ICurrentTenant, Volo.Abp.Identity.IUserRoleFinder)'.
[humanresource-service_3e0ba3d1-e]:
[humanresource-service_3e0ba3d1-e]: See https://autofac.rtfd.io/help/no-constructors-bindable for more info.
[humanresource-service_3e0ba3d1-e]: at Autofac.Core.Activators.Reflection.ReflectionActivator.<>c__DisplayClass14_0.<UseSingleConstructorActivation>b__0(ResolveRequestContext ctxt, Action`1 next)
[humanresource-service_3e0ba3d1-e]: at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
[humanresource-service_3e0ba3d1-e]: at Autofac.Builder.RegistrationBuilder`3.<>c__DisplayClass41_0.<PropertiesAutowired>b__0(ResolveRequestContext ctxt, Action`1 next)
[humanresource-service_3e0ba3d1-e]: at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
Also, here's an image related to the code issue:
I will reproduce this issue in the public project
Thank you!
from eshoponabp.
Related to the above comment, I have fixed it; there was a dependency issue in the host (AbpIdentityHttpApiClientModule).
from eshoponabp.
from eshoponabp.
However, the issue arises when we call the application configuration endpoint; to get permissions .. the newly added permissions don't appear unless we rebuild the AdministrationService.
You can wait for 30 seconds to refresh the memory cache.
from eshoponabp.
Hello,
Thank you for your prompt response. the refresh isn't happening even after waiting for more than 30 seconds.
Regarding our code to clear the cache:
protected virtual Task ClearStoreCacheAsync()
{
_storeCache.LastCheckTime = null;
_storeCache.CacheStamp = null;
return Task.CompletedTask;
}
We're calling this code after inserting new permissions.
Do you have any further insights into why the cache might not be refreshing as expected?
Thank you.
from eshoponabp.
hi
Can you share a project to show this problem? You can upload it to GitHub.
from eshoponabp.
hi
Can you update your tye.yaml
file and share the steps to reproduce?
I have some doubts about running your app and authentication.
from eshoponabp.
The project I shared with you is the same as eShopOnAbp. I downloaded it, and we've made the following changes:
Please note the changes we've made in the latest version of eShop code:
Additionally, we modified the type.yml to only run the cmskit-service and administration-service, similar to the setup in tye.yaml. You can use it.
from eshoponabp.
I will run the run-tye.ps1
, What are the next steps?
from eshoponabp.
When the gateway is open, please open two tabs: one for the administration-service and another for the cmskit-service.
In the cmskit-service Swagger, call the endpoint CreatePermission in SimpleAppService to create dynamic permissions.
Subsequently,
In administration-service Swagger, call the endpoint Get in AbpApplicationConfigurationAppService to retrieve the current user with their permissions.
You'll notice that the permission (created in CreatePermission) is not found only after you rebuild the admin service.
Further details can be found in the commmet
from eshoponabp.
hi
You can inject the
IDistributedCache DistributedCache
and remove the$"{CacheOptions.KeyPrefix}_AbpInMemoryPermissionCacheStamp";
cache.I will find a way on the framework.
hi
I checked the source code.
The StaticPermissionSaver
will update the cache value. Can you try to debug this class to see what's happened?
from eshoponabp.
@maliming Please help me !
I run demo eShopOnAbp in local. I find a problem !
When update Permission with Module Permission-Manager.
- In Roles menu, update permission then menu can auto render in SideMenuLayoutModule
- But in Users menu, it cant auto render.
I check in Caching Service with Redis. R,pk have update, but U,pk is not.
I did review code in Abp and Permission Module. Fuction update Role and User permission is the same api.
Please help me why permission it not update in caching
from eshoponabp.
hi @StevenNgoc
Please create a new issue, and share the steps.
Thanks.
from eshoponabp.
Related Issues (20)
- CartWidget Model (basket items) is null on initial load
- Permission management system with external openid-provider (keycloak) HOT 1
- Deploy v2.0-preview
- Back-office application unsupported mime type error
- UI revamp for public-web application after LaptonX
- Normalize angular packages and configurations
- When will Translation 2.0 be developed? HOT 1
- Running Docker script, program cannot open properly。help HOT 5
- MVC service with keycloak HOT 3
- Update docker-compose for keycloak
- Add demo website GitHub link to the footer
- Unexpected Casting Error in AbpApplicationConfigurationController.GetAsync after ABP Framework Update to 7.4.3 and .NET 8 HOT 3
- Update to ABP v8
- Update Kubernetes deployment to v8
- dev debbuger problem
- Product images are not available on K8s deployment HOT 1
- Admin app localization problem HOT 1
- Moving Localization from JSON Files to Database HOT 1
- Update Permission User but do not render Sidemenu. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eshoponabp.