-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

keith Pope wrote:
> I personally prefer to put the acl in the Model, this way your access
> control is at the model level not the application level meaning you
> can use the Model in other contexts outside the MVC.
> 

Right, which is what I think I am doing, in that the model (the
service/gateway more precisely) is checking if the current user is
allowed to perform the action. The issue that arises however, is when
instantiating the ACL, the model of the module doesn't know the roles
that are available within the application it is a part of.

For example, take the ubiquitous guestbook module. The guestbook service
asserts that posting an entry requires "create" permission the the
"post" resource, which is fine. But who (role) does it allow permission
to when it doesn't know what roles exist?

It seems either the guestbook module has to be aware of a set of roles
and be responsible for assigning permission to them, or something else
(either the application or the auth module) has to be aware of the
resources/privileges enforced by the module and assign its roles
permission. Either way, the "drop in" module seems impossible without
some standardization or roles. Is there an alternative I'm missing?

> 2009/6/21 Brenton Alker <[email protected]>:
> Hi,
> 
> I am working on the architecture of a new ZF application and have am
> questioning which module is responsible for assigning permissions to the
> ACL.
> 
> I have an Auth module that manages the ACL for the application. The Auth
> module exposes an Authorization service, which is used by services of
> other modules to check the ACL. Does this seem like a good structure?
> 
> But the main issue I'm seeking advice on is where the permissions should
> be set. The Auth module doesn't know about the resources of the other
> modules, and the other modules don't know about the roles defined in the
> Auth module. So should the application (aka. default module), which
> knows about both, assign the permissions? Does this violate the idea
> that permissions are business logic and thus should be defined in the model?
> 
> Any insight appreciated, thanks.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAko+PAQACgkQ7bkAtAithuvwIwCgx+l1+m7kACePaRJ6qRJD/0wL
4zQAoI3eF53kGzovPChPKig10UifGB3s
=tetY
-----END PGP SIGNATURE-----

Reply via email to