XF 1.5 Checking Permissions in PHP?

Gossamer

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:
PHP:
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']);

print_r($user['global_permission_cache']);

if(!XenForo_Permission::hasPermission($user['permissions'], 'rps_roleplaysystem', 'rps_activityCheckEnabled'))
{
return false;
}
else
{
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.
 
Back
Top Bottom