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

Using permissions

Discussion in 'XenForo Development Discussions' started by LordsKing, Aug 27, 2014.

  1. LordsKing

    LordsKing 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 :)
  2. dougiemac

    dougiemac Member

    I did this in the Developer tab of the admin CP , under the Permissions area of the left side navigation: Permission Definitions.
  3. Aayush

    Aayush Well-Known Member

    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.

Share This Page