What the Heck Is That Permission Called??!!!

Apr 11, 2014 4:11:00 PM Clint

Role_permission access to MYsqlOk, so this is a very focused blog post, especially for my first return to the blog-o-sphere in a while, but I've gotten so much benefit from very focused blog posts that I had to throw this out there. From time to time, I find myself needing to specific a very particular Drupal permission in my access arguments for hook_menu. Well, if you didn't know - you can see the whole list by simply accessing your MySQL database and viewing the contents of the role_permission table. You can even search for specific groupings, such as Commerce , with a query like this.

select * from role_permission where permission like '%commerce%' order by permission

Need permission breakdowns by role? (which can be much faster than browsing the ginormous permissions page)

select r.rid,r.name,rp.permission,rp.module from role_permission rp inner join role r on rp.rid=r.rid where rp.permission like '%commerce%' order by r.name,rp.permission

So there you have it! If you don't mind looking in the database, you can sometimes find more information more quickly than clicking around Drupal's administrative interface.

Happy Palm Sunday!

Topics: Drupal, MySQL