I'm also trying to decide on the best way to handle security, specifically
restricting access to certain details to the appropriate people.  CakePHP
provides low-level support for a few methods, but generally leaves the
details to the application.  All of the options discussed below are
predicated on a common login component, which I've already sorted out how to
handle in a plug-in manner that will work in a stand-alone environment but
also allow easy integration with Zikula, Drupal, etc.

One common way, which I've used in other apps, is what they call "admin
routing", whereby administrative actions have URLs that would look like
/leaguerunner/admin/field/edit/1, while normal actions have URLs like
/leaguerunner/field/view/1.  This is great for apps where admin actions are
completely separated from "unauthorized" actions, but I started down this
road and found that it doesn't map well for Leaguerunner.

The second most common option is for the various controllers to do their own
security checking (using the tools provided by CakePHP).  This is perhaps
the closest to how Leaguerunner currently works, but there are problems with
this.  In particular, the code for things like checking whether the current
user is allowed to see another person's contact information is quite
complex.

The third method is to use CakePHP's ACL (access control list) component.
This requires setting up ACOs (access control objects, for example a
person's contact information), AROs (access request objects, basically just
users and groups), and then providing varying levels of access (create,
read, update, delete) for AROs accessing ACOs.  This is a very powerful and
flexible system (though it doesn't provide for a user being in multiple
groups, which seems like a significant oversight), and the security checks
are pretty much all handled by the framework, moving the complex decision
logic out of the controllers.  However, it requires a carefully crafted set
of permissions and, more significantly, careful synchronization of those
permissions.  I think that, technically, this is the best solution; however,
it does create the steepest learning curve for casual developers looking to
tweak their Leaguerunner installation or contribute to the project in
general.

As always, comments are very welcome.

Greg.

_______________________________________________
Leaguerunner mailing list
[email protected]
http://www.dmo.ca/cgi-bin/mailman/listinfo/leaguerunner

Reply via email to