Base solution for your next web application
Open Closed

Permissions Updated When? #2122


User avatar
0
bbakermmc created

I created some new permissions in my AuthorizationProvider and assigned them to some navigation nodes. But when I add them to the table in the DB it doesnt take affect until I restart the app pool? This doesnt seem normal, am I missing something someplace?

Once i restart the app pool/VS the nodes appear just fine. Do I need to call a method just for testing until I build out the role/permissions screens?


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Permissions are cached, so you need to clear the cache or restart your app. This is normal if you add those records by hand.

    You can manage this case when you develop user/role permission assignments screens.

  • User Avatar
    0
    bbakermmc created

    Can you point me in the direction of what cache/method I need to call so I dont need to keep resting my app and can just create a simple end point for now :)

  • User Avatar
    0
    ismcagdas created
    Support Team

    of course, you can inject ICacheManager into class you want, and then call one or both of these lines

    _cacheManager.GetUserPermissionCache().Clear();
    _cacheManager.GetRolePermissionCache().Clear();