Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

roles & permission problem-'Garden','Conversations','Vanilla' & 'Plugins' not showing after upgrade

fh111fh111 Vanilla Padawan ✭✭
edited April 2012 in Vanilla 2.0 - 2.8

I don't understand why this is happening. I can't manage the roles and permissions for 'Garden', 'Conversations', 'Vanilla' and 'Plugins'.

This is what I expect to see

This is what I see

The community was 'on ice' for 2 months. Back then i was using 2.0.18.1 and i used vanilla porter to export all content.

A week ago i set up a clean install of 2.0.18.1 on our new server, imported the content. then i upgraded to the most recent version 2.0.18.4. then i went to http://mydomain.com/utility/structure

it said:
update GDN_User User set Permissions = '' where Permissions <> '';

i thought that would solve it, but it did not. when i wanted to adjust permissions for a role, i noticed that i can't.

now it only shows the permission settings for one plugin, kPoll - which i installed after i upgraded.

anyone know where the problem could be?

Best Answers

  • peregrineperegrine MVP
    Answer ✓

    also you might reinstall vanilla, download the latest version and see if that fixes it. Someone just mentioned they reloaded it.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    Answer ✓

    Probably happened with vanilla porter - which I never needed to use. They are working on it I believe. Until then probably the thing to do is.
    1 Install latest 2.18 version.
    2 export (dump) the permissions table and save it.
    3 export (dump) the role table and save it.
    4 do the vanilla porter deal.
    5 import the two tables
    6 adjust accordingly in the dashboard any missing roles you created, adjust users to match roles, and category permissions, and fine tune the table that matches the user to the role.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Answers

  • fh111fh111 Vanilla Padawan ✭✭
    edited April 2012

    @todd
    @tim

    one of my mods just notified me that he does not even have mod status, even though he has the role 'moderator'. so it seems like i am the only one with rights.

    what can i do?

    edit:
    also, every time i go to http://mydomain.com/utility/structure it wants to perform the same changes. so it does not really apply them

  • peregrineperegrine MVP
    edited April 2012
    Log in as the root user or the user with the lowest id.
    if it doesn't give you the the full dashboard permissions
    
    then you could modify the tables themselves.
    

    They are mustly binary in the permissions table a 1 or 2 in the right most columns give you the ability to do what the clumn title descriptively says. A 0 usually means no.

    look in then GDN_Role` table
    look for administrator role.
    
    if it is not there create one temporarily with these values
    
    16  Administrator   Administrators have permission to do anything.  7   1   1
    
    
    then go to the user role table 
    in column one place yourself (your id) in this example, I am user id 1 with role id of 16
    
    1   16
    you will now be administrator role.
    
    
    in the permissions table change all the columns that start with garden  and vanilla to a 1
    especially the garden settings manage column.
    7   16  NULL    NULL    NULL    0   1  
    
    then as yourself you will now have administrator privs , then go into permissions and roles and clean things up in the dashboard.
    column 7 (vanilla or garden settings manage)  will give you the ability to manage.
    

    also see:
    http://vanillaforums.org/discussion/comment/157731#Comment_157731

    also I think Underdog created some other documentation in the wiki, but I am not sure.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited April 2012

    This should give you an idea. of the permissions layout with 1 designated permission

    GDN_Permission(PermissionID,RoleID,JunctionTable,JunctionColumn,JunctionID,Garden.Email.Manage,Garden.Settings.Manage,Garden.Settings.View,Garden.Routes.Manage,Garden.Messages.Manage,Garden.Applications.Manage,Garden.Plugins.Manage,Garden.Themes.Manage,Garden.SignIn.Allow,Garden.Registration.Manage,Garden.Applicants.Manage,Garden.Roles.Manage,Garden.Users.Add,Garden.Users.Edit,Garden.Users.Delete,Garden.Users.Approve,Garden.Activity.Delete,Garden.Activity.View,Garden.Profiles.View,Garden.Profiles.Edit,Garden.Moderation.Manage,Garden.AdvancedNotifications.Allow,Conversations.Moderation.Manage,Vanilla.Settings.Manage,Vanilla.Categories.Manage,Vanilla.Spam.Manage,Vanilla.Discussions.View,Vanilla.Discussions.Add,Vanilla.Discussions.Edit,Vanilla.Discussions.Announce,Vanilla.Discussions.Sink,Vanilla.Discussions.Close,Vanilla.Discussions.Delete,Vanilla.Comments.Add,Vanilla.Comments.Edit,Vanilla.Comments.Delete`

    Above are the columns

    this is an example of permission id #7 with dashboard settings permissions, you may not need all the columns but they are in the correct sequence.

    "7";"16";NULL;NULL;NULL;"0";"1";"1";"1";"0";"1";"1";"1";"1";"1";"1";"1";"1";"1";"1";"1";"1";"1";"1";"1";"0";"1";"0";"1";"1";"1";"0";"0";"0";"0";"0";"0";"0";"0";"0";"0";"0";"1";"1";"0";"0";"0";"0";"0";"0";"0";"0";"0"

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • fh111fh111 Vanilla Padawan ✭✭

    Cool! Thanks for the input, I will check this out as soon as I have time. Looks promising! : )

  • fh111fh111 Vanilla Padawan ✭✭

    i just tried this and it did not do the trick. is it possible that the error does not have it's roots in the sql? by any chance?

  • peregrineperegrine MVP
    edited April 2012

    It's always possible it could be something else. I don't know.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited April 2012
    // Role Table
    $Construct->Table('Role');
    
    $RoleTableExists = $Construct->TableExists();
    
    $Construct
       ->PrimaryKey('RoleID')
       ->Column('Name', 'varchar(100)')
       ->Column('Description', 'varchar(500)', TRUE)
       ->Column('Sort', 'int', TRUE)
       ->Column('Deletable', 'tinyint(1)', '1')
       ->Column('CanSession', 'tinyint(1)', '1')
       ->Set($Explicit, $Drop);
    
    if (!$RoleTableExists || $Drop) {
       // Define some roles.
       //** Note that every RoleID must be a power of two so that they can be combined as a bit-mask.**
       $RoleModel = Gdn::Factory('RoleModel');
       $RoleModel->Database = $Database;
       $RoleModel->SQL = $SQL;
    //   $RoleModel->Define(array('Name' => 'Banned', 'RoleID' => 1, 'Sort' => '1', 'Deletable' => '1', 'CanSession' => '0', 'Description' => 'Banned users are not allowed to participate or sign in.'));
       $RoleModel->Define(array('Name' => 'Guest', 'RoleID' => 2, 'Sort' => '2', 'Deletable' => '0', 'CanSession' => '0', 'Description' => 'Guests can only view content. Anyone browsing the site who is not signed in is considered to be a "Guest".'));
       $RoleModel->Define(array('Name' => 'Applicant', 'RoleID' => 4, 'Sort' => '3', 'Deletable' => '0', 'CanSession' => '1', 'Description' => 'Users who have applied for membership, but have not yet been accepted. They have the same permissions as guests.'));
       $RoleModel->Define(array('Name' => 'Member', 'RoleID' => 8, 'Sort' => '4', 'Deletable' => '1', 'CanSession' => '1', 'Description' => 'Members can participate in discussions.'));
       $RoleModel->Define(array('Name' => 'Moderator', 'RoleID' => 32, 'Sort' => '5', 'Deletable' => '1', 'CanSession' => '1', 'Description' => 'Moderators have permission to edit most content.'));
       $RoleModel->Define(array('Name' => 'Administrator', 'RoleID' => 16, 'Sort' => '6', 'Deletable' => '1', 'CanSession' => '1', 'Description' => 'Administrators have permission to do anything.'));
       $RoleModel->Define(array('Name' => 'Confirm Email', 'RoleID' => 3, 'Sort' => '7', 'Deletable' => '1', 'CanSession' => '1', 'Description' => 'Users must confirm their emails before becoming full members. They get assigned to this role.'));
       unset($RoleModel);
    }
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • // Only Create the permission table if we are using Garden's permission model.
    $PermissionModel = Gdn::PermissionModel();
    $PermissionModel->Database = $Database;
    $PermissionModel->SQL = $SQL;
    $PermissionTableExists = FALSE;
    if($PermissionModel instanceof PermissionModel) {
       $PermissionTableExists = $Construct->TableExists('Permission');
    
        // Permission Table
        $Construct->Table('Permission')
            ->PrimaryKey('PermissionID')
            ->Column('RoleID', 'int', 0, 'key')
            ->Column('JunctionTable', 'varchar(100)', TRUE) 
            ->Column('JunctionColumn', 'varchar(100)', TRUE)
            ->Column('JunctionID', 'int', TRUE)
            // The actual permissions will be added by PermissionModel::Define()
            ->Set($Explicit, $Drop);
    }
    
    // Define the set of permissions that Garden uses.
    $PermissionModel->Define(array(
       'Garden.Email.Manage',
       'Garden.Settings.Manage',
       'Garden.Settings.View',
       'Garden.Routes.Manage',
       'Garden.Messages.Manage',
       'Garden.Applications.Manage',
       'Garden.Plugins.Manage',
       'Garden.Themes.Manage',
       'Garden.SignIn.Allow' => 1,
       'Garden.Registration.Manage',
       'Garden.Applicants.Manage',
       'Garden.Roles.Manage',
       'Garden.Users.Add',
       'Garden.Users.Edit',
       'Garden.Users.Delete',
       'Garden.Users.Approve',
       'Garden.Activity.Delete',
       'Garden.Activity.View' => 1,
       'Garden.Profiles.View' => 1,
       'Garden.Profiles.Edit' => 'Garden.SignIn.Allow',
       'Garden.Moderation.Manage',
       'Garden.AdvancedNotifications.Allow'
       ));
    
    if (!$PermissionTableExists) {
    
       // Set initial guest permissions.
       $PermissionModel->Save(array(
          'RoleID' => 2,
          'Garden.Activity.View' => 1,
          'Garden.Profiles.View' => 1,
          'Garden.Profiles.Edit' => 0
          ));
    
       // Set initial confirm email permissions.
       $PermissionModel->Save(array(
           'RoleID' => 3,
           'Garden.Signin.Allow' => 1,
           'Garden.Activity.View' => 1,
           'Garden.Profiles.View' => 1,
           'Garden.Profiles.Edit' => 0
           ));
    
       // Set initial applicant permissions.
       $PermissionModel->Save(array(
          'RoleID' => 4,
          'Garden.Signin.Allow' => 1,
          'Garden.Activity.View' => 1,
          'Garden.Profiles.View' => 1,
          'Garden.Profiles.Edit' => 0
          ));
    
       // Set initial member permissions.
       $PermissionModel->Save(array(
          'RoleID' => 8,
          'Garden.SignIn.Allow' => 1,
          'Garden.Activity.View' => 1,
          'Garden.Profiles.View' => 1,
          'Garden.Profiles.Edit' => 1
          ));
    
       // Set initial moderator permissions.
       $PermissionModel->Save(array(
          'RoleID' => 32,
          'Garden.SignIn.Allow' => 1,
          'Garden.Activity.View' => 1,
          'Garden.Moderation.Manage' => 1,
          'Garden.Profiles.View' => 1,
          'Garden.Profiles.Edit' => 1
          ));
    
       // Set initial admininstrator permissions.
       $PermissionModel->Save(array(
          'RoleID' => 16,
          'Garden.Settings.Manage' => 1,
          'Garden.Routes.Manage' => 1,
          'Garden.Applications.Manage' => 1,
          'Garden.Plugins.Manage' => 1,
          'Garden.Themes.Manage' => 1,
          'Garden.SignIn.Allow' => 1,
          'Garden.Registration.Manage' => 1,
          'Garden.Applicants.Manage' => 1,
          'Garden.Roles.Manage' => 1,
          'Garden.Users.Add' => 1,
          'Garden.Users.Edit' => 1,
          'Garden.Users.Delete' => 1,
          'Garden.Users.Approve' => 1,
          'Garden.Activity.Delete' => 1,
          'Garden.Activity.View' => 1,
          'Garden.Profiles.View' => 1,
          'Garden.Profiles.Edit' => 1,
          'Garden.AdvancedNotifications.Allow' => 1
          ));
    }
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    Answer ✓

    also you might reinstall vanilla, download the latest version and see if that fixes it. Someone just mentioned they reloaded it.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • fh111fh111 Vanilla Padawan ✭✭

    Thanks! you set me on the right track. I had a backup of the mysql from before i did the upgrade. so i imported one by one the tables and it seem like the GDN_Permission table was pretty messed up. Took me 5 hours of moving tables around and I don't know how exactly this happened. Happy it finally works, but now i am on 2.0.18.1 .. so i wonder what happens if i upgrade :-D

  • Well Back up all the tables of the working version, just in case. If you are not doing any migration, one would think just overwriting the new source code files of 2.0.18.3 etc. should work. I don't believe you need to do any more utility structure changes, nor should the database be modifed (I am assuming here). Just don't add any more plugins and multiple things. Do one step at a time and test and backup. If after you upgrade to newer version and it works correctly, then you can messa around with any plugins you might want to add.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • fh111fh111 Vanilla Padawan ✭✭
    edited April 2012

    Thanks for the advice. I am still on 2.0.18.1 though, that was the version we used before the community went on ice for 2 months. Will try to do the 2.0.18.4 update tonight, just to see what happens. of course i made sure i have everything backed up properly : )

  • Once you are on the 2.0.18.x track (e.g. 2.0.18.1) - I don't believe there is a structural change to the databases. I know 2.18.0.3 works fine, and the other versions probably do to.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • fh111fh111 Vanilla Padawan ✭✭

    cool! i really wonder how this happened then, because I began on the 2.0.18.x track. but as long as it works after updating to 2.0.18.4 i actually don't really care too much.

  • peregrineperegrine MVP
    Answer ✓

    Probably happened with vanilla porter - which I never needed to use. They are working on it I believe. Until then probably the thing to do is.
    1 Install latest 2.18 version.
    2 export (dump) the permissions table and save it.
    3 export (dump) the role table and save it.
    4 do the vanilla porter deal.
    5 import the two tables
    6 adjust accordingly in the dashboard any missing roles you created, adjust users to match roles, and category permissions, and fine tune the table that matches the user to the role.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.