Open Closed

Permissions taking too much time to reflect in the Application #8099


User avatar
0
pvala created
  • 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)
  • User Avatar
    0
    smansuri created

    Any update on this?

  • User Avatar
    0
    pvala created

    Hi, can we get any update on this?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    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.

  • User Avatar
    0
    smansuri created

    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.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    logout and re-login will not invalidate the Permission cache. You should clear the PermissionGrantCacheItem cache from Redis after changing permission in the database.

  • User Avatar
    0
    smansuri created

    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.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    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.

Made with ❤️ on ABP v9.1.0-preview. Updated on October 22, 2024, 09:35