• Resolved benjaminniess

    (@benjaminniess)


    Hi,

    I’m running into a little issue with Authorizer. When a user is logging in for the first time, we can affect him a default role. Now, let’s say that for some reason I need to promote this user to another role. Once he’ll log again, the plugin will unpromoted him and he will get the default role back.

    Is there a way to prevent it to happen?

    Thanks.
    Best,

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Paul Ryan

    (@figureone)

    How are you changing the user’s role? Authorizer has code to synchronize roles between WordPress and its list, but if you’re changing the user’s role programmatically it may not fire.
    https://github.com/uhm-coe/authorizer/blob/master/authorizer.php#L3230-L3274

    Thread Starter benjaminniess

    (@benjaminniess)

    Hi Paul,

    I’m talking about changing a user role in the user edit screen in admin (the native way).

    Thanks

    Plugin Author Paul Ryan

    (@figureone)

    That code block I linked to is the one that should update the user’s role in the Authorizer Approved List whenever you change it on the Edit User screen in WordPress.

    Can you provide some more details on your configuration? I haven’t been able to reproduce your problem.

    Thread Starter benjaminniess

    (@benjaminniess)

    Hi Paul,

    I’m using WordPress multisite, it might be the reason why you can’t reproduce I don’t know.

    To reproduce it :
    – Enable Authorizer in the network and set it up globally as well with a default role as subscriber
    – On a specific site, sign-in with a user
    – It’ll create a user with the subscriber role
    – With a super admin, edit the user on the specific site and promote it to editor
    – Sign-in again with authorizer with the previous user
    – It’ll be unpromoted as subscriber

    Does it make sense?

    Thanks

    Plugin Author Paul Ryan

    (@figureone)

    Thanks for the steps! If I can reproduce the bug I will work on a fix (hopefully this week or next).

    Plugin Author Paul Ryan

    (@figureone)

    Nope, cannot reproduce, sorry. I followed your steps, and the user I promoted to Editor from Subscriber stayed as an Editor after signing in again.

    Please try using a vanilla WordPress install to see if you can trigger what you are seeing. It’s possible there is a hook in your theme or in another plugin that’s interfering with the user roles.

    Thread Starter benjaminniess

    (@benjaminniess)

    Hi Paul,

    Thanks your time, I’ll have a look next week and I’ll let you know if I have more info.

    Thread Starter benjaminniess

    (@benjaminniess)

    Hi Paul,

    My mistake, the problem was due to a third party plugin (Members) which allows to give several roles to users. Deactivating this plugin solved my problem.

    Thank you for your time and for this helpful plugin.

    Best,
    Ben

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Roles updates not saved’ is closed to new replies.