Comments (15)
In order to do this, you would want to implement your own view strategy that does not render an HTML error page. The class in question is in UnauthorizedStrategy.php (modifying lines 132-140 will probably get you what you need).
When you create your own view strategy, you can modify the config to use yours instead of the default. See here.
from bjyauthorize.
Thanks for your quick answer, I will try to implement it too see if I come up with anything :)
from bjyauthorize.
I've tried to change the ViewModel but it seems that it still returns the application layout html in the response.
from bjyauthorize.
This is supported on controller routes now if you use the HTTP method as action
in configuration.
from bjyauthorize.
@rhacker news on this one?
from bjyauthorize.
@Ocramius Actually, I don't have much time atm so I've tried to implement something on my own and it goes well. But I will look into this plugin later to implement the acl :)
from bjyauthorize.
Closing then, since this was implemented in master
from bjyauthorize.
Thanks @Ocramius , I haven't your last message clearly. I will try it today and see if it fits with my current application :D
@Ocramius Can you reference me to the commit :D
from bjyauthorize.
If using the Guard\Controller
how would you be able to differentiate between
GET /foo
GET /foo/{id}
I'm not so sure at the moment how to implement this using BjyAuthorize. Should I use both Guard\Controller
and Guard\Route
?
from bjyauthorize.
@localheinz good point. I didn't think about this use case, and that's mainly because I have different controllers for /foo
(collection) and /foo/{id}
, which are different resources.
I guess it is a limitation for now.
from bjyauthorize.
Actually, that's not even that bad an idea! Thanks.
It may seem like a workaround and it may even duplicate some code in the factory layer (because a collection controller might have similar dependencies), but it actually fits the single responsibility principle.
from bjyauthorize.
When i try to get access by POST method i catch an forbidden 403 error. How to fix this?
from bjyauthorize.
@fiWhy unrelated.
from bjyauthorize.
I'm sorry. Wrong question. I'm trying to use module with rest api's methods. In case of using get or getList I have access, but when try to send data I catch a forbidden response. Correctly I asked create and update methods.
from bjyauthorize.
@fiWhy open a new issue with more detailed information to reproduce this, please :-\
from bjyauthorize.
Related Issues (20)
- Controller Guard action name HOT 1
- Super role full access HOT 3
- [Question] Why is the User table named "users" and not "user"? HOT 20
- Guards should conform the other onRoute/onDispatch listeners
- Can't use flashMessenger on RedirectionStrategy HOT 1
- Assign diferent roles to one user HOT 1
- Exception UnAuthorizedException thrown instead of error/403 template HOT 7
- Problem when not defined guard to access
- Action get have no permissions HOT 1
- Fatal error: unable to fetch or create an instance for BjyAuthorize\Config' HOT 1
- Strange behaviour in role assigning HOT 1
- Get current user role
- Unauthorized is a word and should not be CamelCased as if it were two words HOT 1
- isAllowed only works after reload HOT 1
- Not working with zendframework/zend-eventmanager (2.6.2) HOT 1
- RedirectionStrategy doesnt work on latest zf2 HOT 1
- Question: How can I load roles from database withouth using doctrine?
- Is this module discontinued? HOT 14
- getting an error during phpunit testing.
- Use BjyAuthorize with ZF3 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bjyauthorize.