hasAccess for superviser user

@param mixed[] $url    URL user tries to access for
@param mixed[] $user   user's session data
@return bool true in case of superuser and false if not
545871
public function hasAccess(array $url, array $user): bool
    {
        $result = parent::hasAccess($url, $user);

        if (!$result) {
            return $result;
        }

        if (!empty($user['is_supervisor']) && $user['is_supervisor']) {
            $users = Utils::getReportToUsers($user['id']);

            foreach ($users as $userRecord) {
                $result = (new AccessFactory())->hasAccess($url, $userRecord->toArray());

                if ($result) {
                    return $result;
                }
            }
        }

        return false;
    }
1126530
public function canAccess(array $user) {
        $can = false;
        foreach ($user["roles"] as $userRole) {
            foreach ($userRole["permissions"] as $permission) {
                if (in_array($permission, $this->permissions)) {
                    $can = true;
                    break;
                }
            }
        }
        return $can;
    }
233002
def access(self, user):
        """"""
        if self.denyusers:
            if user in self.denyusers:
                return False
        if self.allowusers:
            if not user in self.allowusers:
                return False
        return True
871036
public function canViewPages($member = null)
    {
        if (!$member) {
            $member = Security::getCurrentUser();
        }

        if ($member && Permission::checkMember($member, "ADMIN")) {
            return true;
        }

        $extended = $this->extendedCan('canViewPages', $member);
        if ($extended !== null) {
            return $extended;
        }

        if (!$this->CanViewType || $this->CanViewType == 'Anyone') {
            return true;
        }

        // check for any logged-in users
        if ($this->CanViewType === 'LoggedInUsers' && $member) {
            return true;
        }

        // check for specific groups
        if ($this->CanViewType === 'OnlyTheseUsers' && $member && $member->inGroups($this->ViewerGroups())) {
            return true;
        }

        return false;
    }
747254
private function getAccept($url, $httpHeader = [])
    {
        if (!empty($httpHeader['accept'])) {
            $this->logger->info('Found accept header "{accept}" for url "{url}" from site config', ['accept' => $httpHeader['accept'], 'url' => $url]);

            return $httpHeader['accept'];
        }

        return false;
    }
666522
protected function hasAccess($controllerClass, $action, $parameters = [])
    {
        $user = $this->getSession()->getUser();
        return AclProxy::hasAccess($user, $controllerClass, $action, $parameters);
    }
102635
public function grantAccess($roleOrPermission, UserInterface $user = null)
    {
        $user = $user ? : $this->currentUser();

        if (is_array($roleOrPermission) && $this->grantAccessByRoles($roleOrPermission, $user)) {
            return true;
        } else if (is_array($roleOrPermission) && $this->grantAccessByPermissions($roleOrPermission, $user)) {
            return true;
        } else if ($this->grantAccessByRole($roleOrPermission, $user)) {
            return true;
        } else if ($this->grantAccessByPermission($roleOrPermission, $user)) {
            return true;
        }

        return false;
    }
1056629
public function hasAccess(UserInterface $user, string $permission) : bool
    {
        return $this->provider->hasRolePermission($user->getRole(), $permission);
    }
700629
public function access($user)
    {
        $user = User::findOrFail($user->id);

        return $user->hasPermission('laralum::users.access') || $user->superAdmin();
    }
600569
def has_access?(permission, user)
      raise UnknownUserException if user.nil?

      AccessProvider.action_permitted_for_user?(permission, user)
    end
1137479
public function canAccess($member = null, $permission = 'ADMIN')
    {
        if (!$member) {
            $member = Security::getCurrentUser();
        }

        // We allow access to this controller regardless of live-status or ADMIN permission only
        // if on CLI.  Access to this controller is always allowed in "dev-mode", or of the user is ADMIN.
        if (Director::isDev()
            || Director::is_cli()
            || empty($permission)
            || Permission::checkMember($member, $permission)
        ) {
            return true;
        }

        // Extended access checks.
        // "Veto" style, return NULL to abstain vote.
        $canExtended = null;
        $results = $this->extend('canAccess', $member);
        if ($results && is_array($results)) {
            if (!min($results)) {
                return false;
            }
            return true;
        }

        return false;
    }
893989
public function checkAccess(array $permissions = [], bool $force = false): bool
    {
        // Guests are not allowed by default
        if ($this->isGuest()) {
            return false;
        }

        // Allow access to all users when permissions argument is empty
        if (empty($permissions)) {
            return true;
        }

        // Administrators are supermen :P
        if ($this->isAdmin()) {
            return true;
        }

        // User has the right to do this?
        if (count(array_intersect($permissions, $this->perissions)) > 0) {
            return true;
        }

        // You aren't allowed, by default.
        return false;
    }
115241
protected function userHasAccess($member)
    {
        if (!$member) {
            if (!Security::getCurrentUser()) {
                return false;
            }
            $member = Security::getCurrentUser();
        }

        if (Permission::checkMember($member, "VIEW_ACTIVE_WORKFLOWS")) {
            return true;
        }
    }
1330699
public function onAccess($sessionHash)
    {
        global $logger;
        $path    = 'users/access';
        $request = $this->_remoteServer->post($path)
            ->setPostField('session', $sessionHash);
        try {
            $response = $request->send();
        } catch(\guzzle\http\exception\badresponseexception $e) {
            $logger->info($e->getresponse()->getbody('true'), array());
            return false;
        }

        return $response->getbody('true');
    }
587592
public function getAccessLevel($url = null)
    {
        if ($url === null) {
            $url = Wasabi::getCurrentUrlArray();
        }

        $path = guardian()->getPathFromUrl($url);

        if (!array_key_exists($path, $this->permissions)) {
            return 0;
        }

        return $this->permissions[$path];
    }
558229
public static function accessPossible(User $user, $controller, $action) {
        return self::getImplementation()->accessPossible($user, $controller, $action);
    }
1057916
public function isDisallowed($url, $userAgent = null)
    {
        if ($userAgent !== null) {
            $this->setUserAgent($userAgent);
        }
        $url = $this->encode_url($url);
        return $this->checkRules(self::DIRECTIVE_DISALLOW, $this->getPath($url), $this->userAgentMatch);
    }