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.