Un utilisateur ayant l'autorisation de changer les droits des autres utilisateurs
peut aussi changer ceux des groupes.
This commit is contained in:
parent
a12132030f
commit
7b0facd9e2
@ -93,7 +93,7 @@ class modUser extends DolibarrModules
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 252;
|
||||
$this->rights[$r][1] = 'Créer/modifier les autres utilisateurs, leurs groupes et permissions';
|
||||
$this->rights[$r][1] = 'Créer/modifier les autres utilisateurs, les groupes et leurs permissions';
|
||||
$this->rights[$r][2] = 'w';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'user';
|
||||
|
||||
@ -38,17 +38,20 @@ $form = new Form($db);
|
||||
|
||||
$module=isset($_GET["module"])?$_GET["module"]:$_POST["module"];
|
||||
|
||||
// Defini si peux modifier utilisateurs et permisssions
|
||||
$caneditperms=($user->admin || $user->rights->user->user->creer);
|
||||
|
||||
|
||||
/**
|
||||
* Actions
|
||||
*/
|
||||
if ($_GET["action"] == 'addrights' && $user->admin)
|
||||
if ($_GET["action"] == 'addrights' && $caneditperms)
|
||||
{
|
||||
$editgroup = new Usergroup($db,$_GET["id"]);
|
||||
$editgroup->addrights($_GET["rights"],$module);
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'delrights' && $user->admin)
|
||||
if ($_GET["action"] == 'delrights' && $caneditperms)
|
||||
{
|
||||
$editgroup = new Usergroup($db,$_GET["id"]);
|
||||
$editgroup->delrights($_GET["rights"],$module);
|
||||
@ -152,7 +155,7 @@ if ($_GET["id"])
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Module").'</td>';
|
||||
if ($user->admin) print '<td width="24"> </td>';
|
||||
if ($caneditperms) print '<td width="24"> </td>';
|
||||
print '<td align="center" width="24"> </td>';
|
||||
print '<td>'.$langs->trans("Permissions").'</td>';
|
||||
print '</tr>';
|
||||
@ -208,7 +211,7 @@ if ($_GET["id"])
|
||||
if (in_array($obj->id, $permsgroup))
|
||||
{
|
||||
// Own permission by group
|
||||
if ($user->admin)
|
||||
if ($caneditperms)
|
||||
{
|
||||
print '<td align="center"><a href="perms.php?id='.$fgroup->id.'&action=delrights&rights='.$obj->id.'">'.img_edit_remove($langs->trans("Remove")).'</a></td>';
|
||||
}
|
||||
@ -219,7 +222,7 @@ if ($_GET["id"])
|
||||
else
|
||||
{
|
||||
// Do not own permission
|
||||
if ($user->admin)
|
||||
if ($caneditperms)
|
||||
{
|
||||
print '<td align="center"><a href="perms.php?id='.$fgroup->id.'&action=addrights&rights='.$obj->id.'">'.img_edit_add($langs->trans("Add")).'</a></td>';
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user