Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method for using Laravel native Policies for API authorization? #45

Closed
GregPeden opened this issue Feb 25, 2017 · 4 comments
Closed

Method for using Laravel native Policies for API authorization? #45

GregPeden opened this issue Feb 25, 2017 · 4 comments
Labels
Milestone

Comments

@GregPeden
Copy link
Contributor

Per the subject...

Laravel uses five method calls in the policy classes to describe permissions: index, create, view, update, delete. These mean the same thing as your five in this package. I'd rather not separate policy settings because of a concern that policy changes in one space won't be replicated to the other.

Any thoughts or suggestions?

@lindyhopchris
Copy link
Member

The Authorizer class is the way that you handle authorization of a JSON API request. I need to add an example to the demo app.

In essence there's an AbstractAuthorizer that can be extended and the authorizer is then injected into your Request class for a resource type (you'll see it's the first argument of the parent constructor).

Our approach is to hand off the Laravel policies via Gate within the Authorizer.

This might make more sense if I add it to the demo app. I'll try to do that but I have pressing work deadlines at the moment so not sure I'm going to be able to do it this week...

@GregPeden
Copy link
Contributor Author

Sounds good, I'll give it a shot!

@lindyhopchris
Copy link
Member

I'm reopening this as a reminder to add it to the demo.

@lindyhopchris lindyhopchris mentioned this issue May 18, 2017
15 tasks
@lindyhopchris lindyhopchris added this to the 1.0.0 milestone Jun 16, 2017
@lindyhopchris
Copy link
Member

Authorization all updated, documented and added to the demo app. See:
https://github.com/cloudcreativity/laravel-json-api/blob/master/docs/basics/security.md

Released as v1.0.0-alpha.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants