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

Commit

Permalink
Avoid reapplying role if already in the user's roles.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Mar 17, 2015
1 parent 8c54d77 commit ddba283
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/plugins/core.auth/class.AbstractAuthDriver.php
Expand Up @@ -314,7 +314,7 @@ public function listChildrenGroups($baseGroup = "/")
public function updateUserObject(&$userObject)
{
$applyRole = $this->getOption("AUTO_APPLY_ROLE");
if(!empty($applyRole)){
if(!empty($applyRole) && !(is_array($userObject->getRoles()) && array_key_exists($applyRole, $userObject->getRoles())) ){
$rObject = AuthService::getRole($applyRole, true);
$userObject->addRole($rObject);
$userObject->save("superuser");
Expand Down

0 comments on commit ddba283

Please sign in to comment.