Comments (6)
Yes, however you will need to write an Identity Provider that will pull the current user's roles from the database using Doctrine. By default, the module uses BjyAuthorize\Provider\Identity\ZfcUserZendDb as an identity provider, but this can be overridden in your configuration (like so: http://bjyoungblood.com/caps/0feab4.png). I would accept a PR if you want to write a provider for Doctrine.
You can see my Zend\Db example and the interface to implement.
I would have included one, but I don't know or use Doctrine.
from bjyauthorize.
I'm going to try to write this provider.
Can you tell me what is schema.sql?
The same as zfcUserAcl ? https://github.com/bjyoungblood/ZfcUserAcl/blob/master/data/schema.sql
Is BjyAuthorize replace zfcUserAcl ?
David
from bjyauthorize.
Yes, same schema. I'll copy it to this repository.
@EvanDotPro wants this to replace ZfcAcl and ZfcUserAcl, but he needs to talk to the rest of the ZF-Commons team first. I would recommend using this module over those two regardless.
from bjyauthorize.
Here is ZfcUserDoctrine Provider: http://pastebin.com/yG0S31f5
Then you must add following factory into your module.php :
'BjyAuthorize\Provider\Identity\ZfcUserDoctrine' => function ($sm) {
$em = $sm->get('doctrine.entitymanager.orm_default');
#$connection = $sm->get('doctrine.connection.orm_default');
$provider = new Provider\Identity\ZfcUserDoctrine($em);
$provider->setUserService($sm->get('zfcuser_user_service'));
return $provider;
},
And add into your composer.json:
"zf-commons/zfc-user-doctrine-orm": "dev-master",
David
from bjyauthorize.
@spiffyjr work on another system based upon RBAC wich would replace Zend\Acl:
https://github.com/SpiffyJr/SpiffySecurity/issues/2
from bjyauthorize.
Added the doctrine provider. Thank you!
As for SpiffySecurity, @spiffyjr and I have talked about it, and we decided to keep the modules separate since we each have different preferences when it comes to ACL vs. RBAC. Also, this allows users a choice between ACL and RBAC.
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.