Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit d119ff2

Browse files
committed
Make sure super admin is never locked out.
Role overriding seemed in the wrong order for shared users, to be verified
1 parent c70aed2 commit d119ff2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/src/plugins/core.conf/class.AbstractAjxpUser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,11 @@ public function removeLock()
223223

224224
public function getLock()
225225
{
226+
if($this->isAdmin() && $this->getGroupPath() == "/") return false;
226227
if (!empty($this->rights["ajxp.lock"])) {
227228
return $this->rights["ajxp.lock"];
228229
}
229230
return $this->mergedRole->filterParameterValue('core.conf', 'USER_LOCK_ACTION', AJXP_REPO_SCOPE_ALL, false);
230-
//return false;
231231
}
232232

233233
public function isAdmin()
@@ -431,14 +431,14 @@ public function recomputeMergedRole()
431431
//... but we want the parent user's role, filtered with inheritable properties only.
432432
$stretchedParentUserRole = AuthService::limitedRoleFromParent($this->parentUser);
433433
if ($stretchedParentUserRole !== null) {
434-
$this->parentRole = $this->parentRole->override($stretchedParentUserRole);
434+
$this->parentRole = $stretchedParentUserRole->override($this->parentRole); //$this->parentRole->override($stretchedParentUserRole);
435435
// REAPPLY SPECIFIC "SHARED" ROLES
436436
foreach ($this->roles as $role) {
437437
if(! $role->autoAppliesTo("shared")) continue;
438438
$this->parentRole = $role->override($this->parentRole);
439439
}
440440
}
441-
$this->mergedRole = $this->parentRole->override($this->personalRole);
441+
$this->mergedRole = $this->personalRole->override($this->parentRole); // $this->parentRole->override($this->personalRole);
442442
}
443443
}
444444

0 commit comments

Comments
 (0)