Skip to content

Commit

Permalink
is_allowed improvement (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
REJack committed Sep 20, 2016
1 parent f54cab0 commit e9e1503
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions application/libraries/Aauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -1612,17 +1612,14 @@ public function is_allowed($perm_par, $user_id=FALSE){
if( $query->num_rows() > 0){
return TRUE;
} else {
if( $user_id===FALSE){
return $this->is_group_allowed($perm_id);
} else {
$g_allowed=FALSE;
foreach( $this->get_user_groups($user_id) as $group ){
if ( $this->is_group_allowed($perm_id, $group->id) ){
$g_allowed=TRUE;
}
$g_allowed=FALSE;
foreach( $this->get_user_groups($user_id) as $group ){
if ( $this->is_group_allowed($perm_id, $group->id) ){
$g_allowed=TRUE;
break;
}
return $g_allowed;
}
return $g_allowed;
}
}

Expand Down

0 comments on commit e9e1503

Please sign in to comment.