Re: permissions
Jan Schneider <[email protected]> Thu, 26 May 2005 17:03:15 +0200
| Newsgroups | gmane.comp.horde.whups |
|---|---|
| Message-ID | <[email protected]> |
Zitat von Todd Merritt <[email protected]>: > On Wed, 2005-05-25 at 21:26 +0200, Jan Schneider wrote: >> Zitat von Todd Merritt <[email protected]>: >> >> > On Wed, 2005-05-25 at 20:27 +0200, Jan Schneider wrote: >> >> Zitat von Todd Merritt <[email protected]>: >> >> >> >> > 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 >> >> Giapto is a bad example because it doesn't use this new feature. >> >> > trying to do. All the other api.phps simply add permission names, not >> > possible values. >> >> You can create your free values with this feature. If you want a >> selection, create an enum permission type. >> >> Jan. >> > I see what you're talking about now, sorry to be a pest. What I don't > see is where the interface to set those values is. I tried looking > around at imp and ingo and I don't see where it is. Could you give me > one last pointer :) $perms['tree']['ingo']['foo'] = false; $perms['title']['ingo:foo'] = _("Foo"); $perms['type']['ingo:foo'] = 'enum'; $perms['params']['ingo:foo'] = array(array('one' => _("One"))); Would be great if you could add some notes in the developer section of the wiki. Jan. -- Do you need professional PHP or Horde consulting? http://horde.org/consulting/ -- Whups mailing list - Join the hunt: http://horde.org/bounties/#whups Frequently Asked Questions: http://horde.org/faq/ To unsubscribe, mail: [email protected]