[whups] permissions

Todd Merritt tmerritt at email.arizona.edu
Wed May 25 11:42:31 PDT 2005


On Wed, 2005-05-25 at 20:27 +0200, Jan Schneider wrote:
> Zitat von Todd Merritt <tmerritt at email.arizona.edu>:
> 
> > I think I didn't explain what I was looking for clearly.  In Perms.php,
> > it looks like the permissions that can be set are static:
> >
> >    function getPermsArray()
> >    {
> >        return array(PERMS_SHOW => _("Show"),
> >                     PERMS_READ => _("Read"),
> >                     PERMS_EDIT => _("Edit"),
> >                     PERMS_DELETE => _("Delete"));
> >    }
> >
> > Would it be acceptable to add somthing to the _<app>_perms function to
> > return a list of perms that are valid for this  object.  In the case of
> > whups, something like:
> >
> > $perms['perms_avail']['whups:queues:' . $id] = array(
> >                               PERMS_ASSIGN => _("Assign"));
> >
> > and have getPermsArray append anything returned by the app to the list ?
> 
> You can create any custom permission types. They only need a matching 
> form field type. See other api.php's for examples.
> 
I've created the custom permissions, using giapeto as a model.  Giapeto
for example adds PERMS_CREATE and PERMS_MOVE, but those do not show up
as options in the permissions administration menu, which is what I'm
trying to do.  All the other api.phps simply add permission names, not
possible values.

Todd




More information about the whups mailing list