Fork me on GitHub
Current releases are 2.1.3 (9 Sept 2014) and 2.0.18.13 (5 Aug 2014)

Ready for 2.1? Find out if your plugins are compatible. 2.0 will no longer be updated after Dec 2014.

[Documentation] repair permissions feature request

edited April 2012 in Vanilla 2.0 Help

I would like to request a "repair permissions" button. When setting up my forums from phpbb I did not have my default roles set so I had a lot of users created without a role. There doesn't seem to be any way to locate all users with a blank role or edit multiple users at once.

My idea is that you could click this button and then assign a role to any user that has no role defined or even change all users of one role to another.

Comments

  • ToddTodd Chief Product Officer Vanilla Staff

    Good idea. In the meantime try the following SQL:

    insert ignore GDN_UserRole (UserID, RoleID)
    select u.UserID, XXX
    from GDN_User u
    left join GDN_UserRole ur
      on u.UserID = ur.UserID
    where ur.UserID is null;
    

    Replace XXX with the RoleID of the role you want to use.

  • I tried this code but it doesn't work for me.

    Todd said: Good idea. In the meantime try the following SQL:

    insert ignore GDN_UserRole (UserID, RoleID)
    select u.UserID, XXX
    from GDN_User u
    left join GDN_UserRole ur
      on u.UserID = ur.UserID
    where ur.UserID is null;
    

    Replace XXX with the RoleID of the role you want to use.

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP
    edited May 2012

    "Doesn't work" doesn't help somebody solve your problem - you need to give a wee bit more of an explanation.

    remove the ignore? and probably 8 is the roleid you want for members

    Do you see any nulls in your UserRole table?

    if yes, after you run the code

    do you still see nulls?

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

    UnderDog
Sign In or Register to comment.