PhalconRest\Api\ApiEndpoint::allow PHP Method

allow() public method

Allows access to this endpoint for role with the given names.
public allow ( ) : static
return static
    public function allow()
    {
        $roleNames = func_get_args();
        // Flatten array to allow array inputs
        $roleNames = Core::array_flatten($roleNames);
        foreach ($roleNames as $role) {
            if (!in_array($role, $this->allowedRoles)) {
                $this->allowedRoles[] = $role;
            }
        }
        return $this;
    }