Coder Social home page Coder Social logo

Comments (6)

bjyoungblood avatar bjyoungblood commented on September 27, 2024

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.

 avatar commented on September 27, 2024

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.

bjyoungblood avatar bjyoungblood commented on September 27, 2024

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.

 avatar commented on September 27, 2024

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.

 avatar commented on September 27, 2024

@spiffyjr work on another system based upon RBAC wich would replace Zend\Acl:

https://github.com/SpiffyJr/SpiffySecurity/issues/2

from bjyauthorize.

bjyoungblood avatar bjyoungblood commented on September 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.