Base solution for your next web application
Open Closed

how to refresh menu if administrator assign admin role while user logged in with out logout #11491


User avatar
0
ictadmin created

Hello Guys, We are having an issue in which when administrator assign or remove admin role. The menus are not refreshing properly without logout and re-login.

We are looking for a solution in which it should refresh all menus and permission of logged user without logout.

Thank you


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

    Hi @ictadmin

    Do you host more than one instance of your app or do you use Redis on your app ? Normally, menu should be refreshed when the user refreshes the page.

    Thanks,

  • User Avatar
    0
    ictadmin created

    We are using on instance of app, menu is refreshing but it is not fetching all the authentication and authorizations objects properly.

    one example of it, like if a super-admin grant admin role to a user, this below method await IsGrantedAsync(AppPermissions.Pages_Administration_Roles)

    not identifying admin role.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Normally, permissions are cached but when a user is granted a permission or role, this cache is invalidated. One last question, do you use Redis in your app ?

    Thanks,

  • User Avatar
    0
    ictadmin created

    This is in our appsettings.json for both web and host projects

    "Abp": { "RedisCache": { "ConnectionString": "localhost", "DatabaseId": -1 } },

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    This doesn't show if Redis is used or not. Could you check if the below line is commented out in your app in {YourAppName}WebCoreModule.cs ?

    //Uncomment this line to use Redis cache instead of in-memory cache.
    //See app.config for Redis configuration and connection string
    //Configuration.Caching.UseRedis(options =>
    //{
    //    options.ConnectionString = _appConfiguration["Abp:RedisCache:ConnectionString"];
    //    options.DatabaseId = _appConfiguration.GetValue<int>("Abp:RedisCache:DatabaseId");
    //});
    
  • User Avatar
    0
    ictadmin created

    I checked, We are not using Redis.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @ictadmin

    Thanks, we will try to reproduce this on our side and we will inform you.

  • User Avatar
    0
    m.aliozkaya created
    Support Team

    Hi @ictadmin,

    I couldn't reproduce the issue. Could you share your project with [email protected] ?