Airship\Engine\Security\Permissions::isSuperUser PHP Method

isSuperUser() public method

Is this user a super user? Do they belong in a superuser group?
public isSuperUser ( integer $user_id, boolean $ignore_groups = false ) : boolean
$user_id integer - User ID
$ignore_groups boolean - Don't look at their groups
return boolean
    public function isSuperUser(int $user_id = 0, bool $ignore_groups = false) : bool
    {
        if (empty($user_id)) {
            // We can short-circuit this for guests...
            return false;
        }
        $statements = ['check_user' => \Airship\queryStringRoot('security.permissions.is_superuser_user', $this->db->getDriver()), 'check_groups' => \Airship\queryStringRoot('security.permissions.is_superuser_group', $this->db->getDriver())];
        if ($this->db->cell($statements['check_user'], $user_id) > 0) {
            return true;
        } elseif (!$ignore_groups) {
            return $this->db->cell($statements['check_groups'], $user_id) > 0;
        }
        return false;
    }