Using permissions


Active member
Hello :)

How can I add some permissions via the Admin CP ?

And how can I use them via a php file ?
It's a permission to view something :)


Well-known member
I did this in the Developer tab of the admin CP , under the Permissions area of the left side navigation: Permission Definitions.
And then in PHP file (or the XF template) you can get it from a method on the XenForo_Visitor object called getPermissions(). It returns an array with an index of addon id which itself contains an array of all the permissions associate with the addon.
Furthermore you can dump the $visitor var in template and access the permissions from there as well.