Check if user is administrator?

For a specific admin permission in a script in the admin area:
Code:
protected function _preDispatch($action)
{
       $this->assertAdminPermission('permission_name');
}

Just to see if they are an admin (which automatically gives access to the ACP):
Code:
$visitor = XenForo_Visitor::getInstance();
if($visitor['is_admin'])
{
    The user is an admin with access to the ACP with what they have access to dependent on administrator permissions.
}
 
For a specific admin permission in a script in the admin area:
Code:
protected function _preDispatch($action)
{
       $this->assertAdminPermission('permission_name');
}

Just to see if they are an admin (which automatically gives access to the ACP):
Code:
$visitor = XenForo_Visitor::getInstance();
if($visitor['is_admin'])
{
    The user is an admin with access to the ACP with what they have access to dependent on administrator permissions.
}
Thanks!
 
Top Bottom