- ABP Framework version: v8.2.1
- UI Type: Angular
- Database System: EF Core (MySQL)
- Tiered (for MVC) or Auth Server Separated (for Angular): Auth Server separated
- Exception message and full stack trace:
- Steps to reproduce the issue:
We are facing an issue in the permissions module of the application. Actually when we add or remove any permission(s) from the AbpPermissionGrants table, by manually updating the table from the database. It takes too much time to reflect on the UI of the application. I am aware that it's getting derived via a caching mechanism but, can I know what should I do in order to make the changes instantly reflected on the UI after updating the permissions manually from the database.
7 Answer(s)
-
0
Any update on this?
-
0
Hi, can we get any update on this?
-
0
hi
can I know what should I do in order to make the changes instantly reflected on the UI after updating the permissions manually from the database.
You'd better not do this. Always do it through code.
The framework will use
IDistributedCache<PermissionGrantCacheItem>
to cache the permission grants.AbsoluteExpiration and SlidingExpiration) used when you don't specify the options while saving cache items. Default value uses the SlidingExpiration as 20 minutes.
https://abp.io/docs/latest/framework/fundamentals/caching#abpdistributedcacheoptions
You can clear the
PermissionGrantCacheItem
cache from redis. -
0
hi
can I know what should I do in order to make the changes instantly reflected on the UI after updating the permissions manually from the database.
You'd better not do this. Always do it through code.
The framework will use
IDistributedCache<PermissionGrantCacheItem>
to cache the permission grants.AbsoluteExpiration and SlidingExpiration) used when you don't specify the options while saving cache items. Default value uses the SlidingExpiration as 20 minutes.
https://abp.io/docs/latest/framework/fundamentals/caching#abpdistributedcacheoptions
You can clear the
PermissionGrantCacheItem
cache from redis.Even if we do populate permission through Database ,logout and relogin should repopulate the permissions correctly. isn't it? user does not have to wait for 20 minutes. moreover we have seen that the permissions to take affect take more than 2 hours at times.
-
0
hi
logout and re-login will not invalidate the
Permission
cache. You should clear thePermissionGrantCacheItem
cache from Redis after changing permission in the database. -
0
This does not sound right as in real word application once you change add/remove permission from existing user through application UI should reflect immediately. For example i want to delete block the user from using the application with immediate effect or remove/add a role/permission. in this case at least on re-login the changes should take effect.
-
0
you change add/remove permission from existing user through application UI should reflect immediately.
Through app UI will work. But you are changing the permission directly in the database.