This is a brief synopsis of the steps required to add arbitrary per-application permissions to the Horde permission system.
In this example we'll add the permission "arbitrary_permission" to module foo.
in foo/lib/api.php:
<?php $_services['perms'] = array( 'args' => array(), 'type' => '{urn:horde}stringArray' ); ?>
and
<?php function _foo_perms() { static $perms = array(); if (!empty($perms)) { return $perms; } $perms['tree']['foo']['arbitrary_permission'] = false; $perms['title']['foo:arbitrary_permission'] = _("Textual description"); $perms['type']['foo:arbitrary_permission'] = 'boolean'; $perms['param']['foo:arbitrary_permission'] = array(); return $perms; } ?>
Then, once you have created an object that you wish to apply those permissions to,
<?php global $perms; $p = $perms->newPermission('foo:arbitrary_permission'); $perms->addPermission($p); ?>
After that, you should see the permission that you created on the permissions administration page.