Habari\User::can_any PHP Method

can_any() public method

Determine if a user has any of a set of tokens
public can_any ( array $token_access = [] ) : boolean
$token_access array An array of tokens and the permissions to check for each of them.
return boolean True if this user has the requested access, false if not
    public function can_any($token_access = array())
    {
        $token_access = Utils::single_array($token_access);
        foreach ($token_access as $token => $access) {
            $access = Utils::single_array($access);
            foreach ($access as $mask) {
                if (is_bool($mask)) {
                    if ($this->can($token)) {
                        return true;
                    }
                } else {
                    if ($this->can($token, $mask)) {
                        return true;
                    }
                }
            }
        }
        return false;
    }