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

XF 1.5 Checking Permissions in PHP?


Active member
I'm trying to create a function to check a custom permission I added. However, it's failing to pull up the permissions I'm looking for.

Here is the code from my Model:
public function userActivityCheckEnabled($user)
$user = $this->getUserById($user, array('join' => XenForo_Model_User::FETCH_USER_PERMISSIONS));

$user['permissions'] = XenForo_Permission::unserializePermissions($user['global_permission_cache']);


if(!XenForo_Permission::hasPermission($user['permissions'], 'rps_roleplaysystem', 'rps_activityCheckEnabled'))
return false;
return true;
I used print_r to get a printout of the contents of the global_permission_cache, and my rps_activityCheckEnabled permission isn't even listed there.