public function canAs(Authorizable $user, string $action): bool
    {
        $this->setUser($user);

        $permission = $this->can($action);

        $this->revokeUser();

        return $permission;
    }
public function canAs(Authorizable $user, string $action): bool
    {
        $this->setUser($user);

        $permission = $this->can($action);

        $this->revokeUser();

        return $permission;
    }
public function canAs ( Authorizable $ user , string $ action ) : bool { $ this -> setUser ( $ user ) ; $ permission = $ this -> can ( $ action ) ; $ this -> revokeUser ( ) ; return $ permission ; }
Verify whether current user has sufficient roles to access the
actions based on available type of access.

@param  \Orchestra\Contracts\Authorization\Authorizable  $user
@param  string  $action     A string of action name

@throws \InvalidArgumentException

@return bool
Verify whether current user has sufficient roles to access the actions based on available type of access .