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

Check if user is administrator?

Snog

Well-known member
#2
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.
}
 
#3
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!