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.

How do I determine a user's role?

edited March 2010 in Vanilla 2.0 - 2.8
I'm trying to add a menu item using the hooks.php file within my application. There are a couple of menu options that I only want to show up for users who have the role of Admin within Garden. How do I determine this?

Comments

  • lucluc ✭✭
    Either you create a new permission, or you use a previously created permission that you check.

    For instance in applications/garden/controllers/profile.php, it does: if ($Session->CheckPermission('Garden.Users.Edit')) {

    You an see all permission in : GDN_Permission, admins are the ones with RoleID == 16 IIRC, but really should limit your stuff to one particular permission.
  • That's what I was looking for. Thanks!
Sign In or Register to comment.