Answers inline

On 11 January 2014 00:54, dennis-fedco [via Zend Framework Community] <
[email protected]> wrote:

> I've been entangling myself in code, while trying to implement a
> RuleProvider to work with BjyAuthorize ZF2 module.
>
> I need a bit of help.  I put my code here for 
> reference<https://github.com/dennis-fedco/BjyRuleProvider>.
>
>
> I am looking for help in some specific areas.
>
> Some problems I am currently experiencing:
> *  FedcoUser/src/FedcoUser/Entity/ControllerGuardRule class - should it
> implement any Providers, like BjyAuthorize\Provider\Rule\ProviderInterface
> interface, or not?
>

Is it a rule? Then you should have a provider that returns a list of these
somewhere.

>
> I ask because it seems that I have
> FedcoUser/src/FedcoUser/Provider/Rule/ObjectRepositoryProvider that already
> implements Rule\ProviderInterface.  All in all, where, and how should I
> retrieve my rules?
>

If you implement the Rule provider interface on the repository, then you
don't need to go any further. Just register the provider with BjyAuthorize.


>
> *  My Doctrine mappings for ControllerGuardRule are out of 
> whack<https://gist.github.com/dennis-fedco/51d994f05a1255396f64>,
> but I have another post on that topic elsewhere (in doctrine forum).
>

This was replied there. I basically suggest using a simple identifier
instead of such a complex composite key, and if not possible, use the
`@JoinColumns` explicitly.


>
> My goal basically is have an application that uses BjyAuthorize and loads
> Rules from the Database via Doctrine.  Can a good soul take a peek at my
> code perhaps and help me untangle myself?
>

Providers are exactly that. To BjyAuthorize, each provider is basically
just like an array. If you implement the provider for Rule, or Resource or
Role or Identity, then you can register it with BjyAuthorize and the module
will pull information out of it.

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/




--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/BjyAuthorize-RuleProvider-from-Doctrine-help-requested-tp4661439p4661448.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to