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

Commit 2a90fa2

Browse files
committed
Fix roles assignment when updating user groupPath
1 parent 2e3cca8 commit 2a90fa2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/src/plugins/conf.sql/SqlUser.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,11 @@ public function setGroupPath($groupPath, $update = false)
584584
}
585585
parent::setGroupPath($groupPath);
586586
dibi::query('UPDATE [ajxp_users] SET ', Array('groupPath'=>$groupPath), 'WHERE [login] = %s', $this->getId());
587+
$r = $this->getRoles();
588+
// REMOVE OLD GROUP ROLES
589+
foreach (array_keys($r) as $role) {
590+
if(strpos($role, "AJXP_GRP_/") === 0) $this->removeRole($role);
591+
}
587592
$this->load();
588593
$this->recomputeMergedRole();
589594
$this->log('UPDATE GROUP: [Login]: '.$this->getId().' [Group]:'.$groupPath);

0 commit comments

Comments
 (0)