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.
Assigning roles using a database

Hey all, bit of a newby to this framework and couldn't find a topic covering this.
I was wondering if you could assign a role to a user based off of a database using PHP, e.g. a user named John Doe belongs to John Doe Ltd who are non-members. Can I assign him the role of Non-Member from a database so I don't have to click on him and assign the role manually?
0
Comments
you could try under GDN_UserRole table, with UserID and RoleID field that looks like role flags or constants. If you can take a look at applications/dashboard/settings/structure.php I think that is one example defined there.
You should avoid writing directly to the database. You better create a short plugin that does exactly what you need. It doesn't need to be sophisticated:
I have not put any code in there, because I'm not quite sure what you try to achieve: if the user is not a member, you will not have him in the user database...
But in order to give a user a special role, you would need something like this: