Merge pull request #14810 from TobiasSekan/FixAdminCanRemoveAllHisUserRights
FIX that a admin can remove all his user rights
This commit is contained in:
commit
03226ad2a5
@ -701,6 +701,15 @@ class User extends CommonObject
|
||||
$sql .= " AND ".$wherefordel;
|
||||
}
|
||||
|
||||
// avoid admin can remove his own important rights
|
||||
if ($this->admin == 1)
|
||||
{
|
||||
$sql .= " AND id NOT IN (251, 252, 253, 254, 255, 256)"; // other users rights
|
||||
$sql .= " AND id NOT IN (341, 342, 343, 344)"; // own rights
|
||||
$sql .= " AND id NOT IN (351, 352, 353, 354)"; // groups rights
|
||||
$sql .= " AND id NOT IN (358)"; // user export
|
||||
}
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user