Base solution for your next web application
Open Closed

Permission Keeps Resetting #8921


User avatar
0
suruat created

Hi,

I am developing a Xamarin Application using Abp Zero for my backend. For some reason, my permission keeps getting reset for my users. For example: If i asign the admin role to a user, that user gets all the the permissions, this is reflected in the web UI and mobile app. Than lets say after a while I reopen the mobile app, than i get an error message saying the the permissions are missing and when I look at the user managerment that user still has the Admin Role, but all permissions are unchecked.

Does anyone have any idea what's happening?


6 Answer(s)
  • User Avatar
    0
    suruat created

    Does anyone have any idea?

  • User Avatar
    1
    ismcagdas created
    Support Team

    Hi @suruat,

    Sorry for the late reply. We haven't faced any problem which can cause this problem in AspNet Zero. Is there any place in your app might cause this problem ? You can add a log to https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Application/Authorization/Users/UserAppService.cs#L230 and check the logs when this happens again.

  • User Avatar
    0
    suruat created

    Thanks for the Tip @ismcagdas, I added some AppInsight Logging. So hopefully this will shed some light for me.

  • User Avatar
    0
    suruat created

    @ismcagdas After some investigation, I am confident the issue is not with the permissions but rather with the roles. There are a few things I am noticing with the Roles.

    1. The Roles name in the database has strange data. The Non Static Roles have mangled strings as names:
    2. When I look at the data, I see that the User has the role assign, both in the UI and in the database and token, But for some reason It stops pulling the permissions to the UI, The problem might be with The GETALL() call as The GrantedPermission is empty. Gonna try debuging that code, I will update with my findings. I just wanted to leave this here first incase you had an answer for me
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    #1 is not a problem. The Name field is used internally, it is not displayed in the UI. Probably the used token is expired. Could you check that when this happens again ?

    Thanks,

  • User Avatar
    0
    suruat created

    Issue resolved, this was due to changes I made to the GetAll() call.