Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Best way to get the current resource name #1762
I am working on a feature that uses policies to authorize requests basing on a user role, an action and a resource.
I have no problem to get the first two, but I am facing issues with getting the resource name, since I only have the full path. Is there any efficient way to get that with any function similar to
I could extract the resource name from the name of the handler, for example:
Lets suppose that handlerName is something like "github.com/company/project/actions.UsersResource.Edit"