Skip to content

Commit

Permalink
change split roles logic
Browse files Browse the repository at this point in the history
  • Loading branch information
aslubsky committed Nov 26, 2013
1 parent 0c942e2 commit 67138a5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions server/Bazalt/Auth/Model/User.php
Expand Up @@ -276,11 +276,13 @@ public function getPermissions($site = null)
}
} else {
$roles = Role::getGuestRoles();
$currentRole = \Bazalt\Auth::getCurrentRole();
if(!$this->isGuest() && $currentRole) {
$roles = [
$currentRole
];
if(!$this->isGuest()) {
$currentRole = \Bazalt\Auth::getCurrentRole();
if($currentRole) {
$roles = [
$currentRole
];
}
}
foreach($roles as $role) {
$res = $role->getPermissions();
Expand Down

0 comments on commit 67138a5

Please sign in to comment.