Source for file GroupRights.php
Documentation is available at GroupRights.php
require_once 'index.php';
echo '<h3>GroupRights</h3>';
$groups = $admin->perm ->getGroups ();
echo '<strong>Error on line: '.__LINE__. '</strong><br />';
} elseif (empty ($groups)) {
echo 'Run the <strong>Group</strong> test first<br />';
$rights = $admin->perm ->getRights ();
echo '<strong>Error on line: '.__LINE__. '</strong><br />';
} elseif (empty ($rights)) {
echo 'Run the <strong>Right</strong> test first<br />';
for ($i = 0; $i < 20; $i++ ) {
'group_id' => $groups[$group]['group_id'],
'right_id' => $rights[$right]['right_id']
$granted = $admin->perm ->grantGroupRight ($data);
if ($granted === false ) {
echo '<strong>Error on line: '.__LINE__. '</strong><br />';
echo 'Group <strong>' . $groups[$group]['group_id'] . '</strong> was granted the right <strong>'. $rights[$right]['right_id']. '</strong><br />';
'group_id' => $groups[$group]['group_id']
$allGroupRights = $admin->perm ->getRights ($params);
if ($allGroupRights === false ) {
echo '<strong>Error on line: '.__LINE__. '</strong><br />';
} elseif (empty ($allGroupRights)) {
echo 'Group <stong>' . $groups[$group]['group_id'] . '</strong> had no rights<br />';
echo '<hr />Here is/are <strong>' . count($allGroupRights) . '</strong> group right(s) for the group <strong>' . $groups[$group]['group_id'] . '</strong>:<br />';
Var_Dump ::display ($allGroupRights);
'right_id' => $rights[$right]['right_id'],
'group_id' => $groups[$group]['group_id']
$removed = $admin->perm ->revokeGroupRight ($filters);
if ($removed === false ) {
echo '<strong>Error on line: '.__LINE__. '</strong><br />';
echo 'Removed the right <strong>'. $right. '</strong> on group <strong>'. $group. '</strong><br />';
'group_id' => $groups[$group]['group_id']
$rights_group = $admin->perm ->getRights ($params);
if ($rights_group === false ) {
echo '<strong>Error on line: '.__LINE__. '</strong><br />';
} elseif (empty ($rights_group)) {
echo 'Group <strong>' . $groups[$group]['group_id'] . '</strong> had no rights<br />';
$data = array ('right_level' => 2 );
'right_id' => $rights_group[$right]['right_id'],
'group_id' => $groups[$group]['group_id']
$updated = $admin->perm ->updateGroupRight ($data, $filters);
if ($updated === false ) {
echo '<strong>Error on line: '.__LINE__. '</strong><br />';
echo 'Updated the right level of <strong>' . $groups[$group]['group_id'] . '</strong><br />';
'right_id' => $rights_group[$right]['right_id'],
'group_id' => $groups[$group]['group_id']
$result = $admin->perm ->getRights ($params);
echo '<strong>Error on line: '.__LINE__. '</strong><br />';
} elseif (empty ($result)) {
echo 'Nothing was found with the right id <strong>' . $rights_group[$right]['right_id'] . '</strong>
and group id <strong>' . $groups[$group]['group_id']. '</strong><br />';
Var_Dump ::display ($result);
$allGroups = $admin->perm ->getRights ($params);
echo 'Here are all the group rights after the changes:<br />';
if ($allGroups === false ) {
echo '<strong>Error on line: '.__LINE__. '</strong><br />';
} elseif (empty ($allGroups)) {
echo 'Found no groups<br />';
Var_Dump ::display ($allGroups);
Documentation generated on Mon, 11 Mar 2019 14:16:44 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|