Support wildcard option to allow full access

This commit is contained in:
Thomas Bruederli 2014-10-11 03:28:17 +02:00
parent 8d13292b38
commit e618f0093c
2 changed files with 6 additions and 2 deletions

View file

@ -53,6 +53,8 @@ $config['kolab_auth_admin_rights'] = array(
'settings' => 'entry:read', 'settings' => 'entry:read',
'mail' => 'entry:delete', 'mail' => 'entry:delete',
'addressbook' => 'entry:delete', 'addressbook' => 'entry:delete',
// or use a wildcard entry like this:
'*' => 'entry:read',
); );
// Enable plugins on a role-by-role basis. In this example, the 'acl' plugin // Enable plugins on a role-by-role basis. In this example, the 'acl' plugin

View file

@ -96,15 +96,17 @@ class kolab_auth extends rcube_plugin
// redirect to the first task on the list // redirect to the first task on the list
if (!empty($_SESSION['kolab_auth_allowed_tasks'])) { if (!empty($_SESSION['kolab_auth_allowed_tasks'])) {
$tasks = (array)$_SESSION['kolab_auth_allowed_tasks']; $tasks = (array)$_SESSION['kolab_auth_allowed_tasks'];
if (!in_array($args['task'], $tasks)) { if (!in_array($args['task'], $tasks) && !in_array('*', $tasks)) {
header('Location: ?_task=' . array_shift($tasks)); header('Location: ?_task=' . array_shift($tasks));
die; die;
} }
// add script that will remove disabled taskbar buttons // add script that will remove disabled taskbar buttons
if (!in_array('*', $tasks)) {
$this->add_hook('render_page', array($this, 'render_page')); $this->add_hook('render_page', array($this, 'render_page'));
} }
} }
}
// load per-user settings // load per-user settings
$this->load_user_role_plugins_and_settings(); $this->load_user_role_plugins_and_settings();