
Social Code
By: a guest on
May 17th, 2012 | syntax:
PHP | size: 1.25 KB | hits: 57 | expires: Never
<?php
/**
*
* Moderators for Roles plugin
*
*
* @author Andras Szepeshazi
* @copyright Arck Interactive, LLC 2012
* @link http://www.arckinteractive.com/
*/
elgg_register_event_handler('init', 'system', 'students_init');
function students_init() {
elgg_register_plugin_hook_handler('roles:config', 'role', 'students_config', 700);
}
function students_config($hook_name, $entity_type, $return_value, $params) {
$roles = array(
'student' => array(
'title' => 'students:role:title',
'extends' => array(),
'permissions' => array(
'actions' => array(
'groups/edit' => array('rule' => 'deny'),
'groups/leave' => array('rule' => 'deny'),
),
'pages' => array(
'groups/add/{$self_guid}' => array('rule' => 'deny'),
'blog/add/{$self_guid}' => array('rule' => 'deny'),
'regexp(/^admin\/$/)' => array('rule' => 'deny'),
),
'menus' => array(
'topbar::administration' => array('rule' => 'deny'),
'title::add' => array(
'rule' => 'deny',
'context' => array('groups')
),
),
),
),
);
if (!is_array($return_value)) {
return $roles;
} else {
return array_merge($return_value, $roles);
}
}
?>