• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Using permissions

LordsKing

Active member
#1
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 :)
 

Aayush

Well-known member
#3
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.