Non-restricted Restler documentation

213 views Asked by At

In the restler documentation https://github.com/Luracast/Restler/tree/master/public/examples/_010_access_control it is said:

"This example shows how you can extend the authentication system to create a robust access control system. As a added bonus we also restrict api documentation based on the same."

However, try as I may, I cannot manage to produce an API documentation that is not restricted while having routes that are. I need to be able to expose all the API end-points even if a given instance of a resource needs authentication. I don't want to write separate documentation to list all the end-points as this seems self-defeating for an auto-generated documentation.

I see that each resource has a lock symbol in the explorer. However, I cannot manage to obtain a closed lock- either the lock is open, either the resource is not displayed.

Has anyone managed to create the authentication system without the added "bonus" of restricting api documentation?

Thanks

1

There are 1 answers

2
Arul Kumaran On

Hiding the documentation of protected api is just a default. You can simply change it with

require_once '../../vendor/restler.php';
use Luracast\Restler\Restler;
use Luracast\Restler\Resources;

Resources::$hideProtected = false; //*  <-

$r = new Restler();
$r->addAPIClass('MyApiClass');
$r->handle();