Browse Source

Merge pull request #84 from REJack/master

Enchantment on is_allowed() function #83
develop
Emre Akay 10 years ago
parent
commit
a236514ec6
  1. 9
      application/libraries/Aauth.php

9
application/libraries/Aauth.php

@ -1463,12 +1463,17 @@ class Aauth {
*/
public function is_allowed($perm_par, $user_id=FALSE){
$perm_id = $this->get_perm_id($perm_par);
if( $user_id == FALSE){
$user_id = $this->CI->session->userdata('id');
}
if($this->is_admin($user_id))
{
return true;
}
$perm_id = $this->get_perm_id($perm_par);
$query = $this->aauth_db->where('perm_id', $perm_id);
$query = $this->aauth_db->where('user_id', $user_id);
$query = $this->aauth_db->get( $this->config_vars['perm_to_user'] );

Loading…
Cancel
Save