Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
ca_ES.inc | 2010-04-19 | 625 Bytes | |
en_EN.inc | 2010-04-19 | 614 Bytes | |
en_US.inc | 2010-04-19 | 614 Bytes | |
es_ES.inc | 2010-04-19 | 798 Bytes | |
Totals: 4 Items | 2.7 kB | 0 |
********************************** * * * Roles and Permissions plugin * * * ********************************** Version: 0.1 - 19.04.2010 Author: Emilio del Giorgio Website: http://sourceforge.net/projects/rolespermission Licence: GPLv3 README This plugin adds two preferences sections for authorized users: 1) A table with all defined users and the assigned roles to each, with the possibility to (un)assign roles to users. Also, the ability to add more roles and users to the table. 2) A table with all defined permissions and the roles assigned to each, with the possibility to (un)assign permissions to roles Aims to reproduce the similar features of Drupal or other softwares. Other plugins may define new permissions and use the framework to determine if a user can or cannot do a concrete action. From now on, this plugin registers a global variable, $roles_perm, which is a link to the plugin instance. For a better functionallity, you should declare your plugin's permissions at __construct time instead of init, so permissions will be known by the system before any user accesses to your plugin pages. Be sure to pass the labels for your plugin permissions at settings task. Example: class my_plugin extends rcube_plugin { private $roles_perm = false; function __construct(&$api) { parent::__construct(&$api); global $roles_perm; if($roles_perm) { $this->roles_perm = $roles_perm; $roles_perm->register_permission(array( 'code' => 'administer_forwardattachment', 'name' => "permission.administer_forwardattachment")); } } function init() { ... if($this->roles_perm === false || $user->data['permissions']['administer_my_plugin']) { $this->roles_perm->register_action('plugin.my-plugin-admin', array($this, 'admin')); $this->include_script('my_plugin_admin.js'); } ... } }