From 136ba686bdd6b71d72c3ad1a7002f91d85d74dbe Mon Sep 17 00:00:00 2001 From: Raphael Jackstadt Date: Tue, 28 Jul 2015 23:13:25 +0200 Subject: [PATCH] fix for #51 'is_allowed() bug ' --- application/libraries/Aauth.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/application/libraries/Aauth.php b/application/libraries/Aauth.php index c893deb..3b5a660 100644 --- a/application/libraries/Aauth.php +++ b/application/libraries/Aauth.php @@ -1472,13 +1472,20 @@ class Aauth { $query = $this->aauth_db->get( $this->config_vars['perm_to_user'] ); if( $query->num_rows() > 0){ - return TRUE; - } elseif ($this->is_group_allowed($perm_id)) { - return TRUE; + return TRUE; } else { - return FALSE; - } - + 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; + } + } + return $g_allowed; + } + } } /**