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;
}