slim-auth
slim-auth copied to clipboard
wildcards
Hello,
Is it possible to use some form of wildcards when adding and allowing access to resources? Something like addResource('/api/*')?
Thanks
@Lorenzbi Not at this point, no, although you might be able to use route groups to accomplish the same thing. I haven't experimented with that.
@jeremykendall That would be perfect but sadly it doesn't work. It looks for /api/tasks and fails. It's a pain to add all the routes and allow each one.
I'll look into it when I get a chance. It would be a really nice addition, I think. If you have any thoughts or suggestions between now and whenever I can get around to this, please let me know.
@Lorenzbi One option would be to implement your own version of JeremyKendall\Slim\Auth\Middleware\Authorization
. You'd simply need to update the $isAuthorized
callback to accept wildcards (or whatever you prefer in your custom implementation).