[eluser]Sawariya[/eluser]
Thanks for your reply here is library..
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Ua_authorize {
var $allowed_users = array(); // Allowed Groups and users
var $denied_users = array(); // Denied Groups and users
var $allowed_set = FALSE; // Has set_allowed() been used
var $denied_set = FALSE; // Has set_denied() been used
var $allow = FALSE; // Cuurent status of permission
function Ua_authorize()
{
$this->obj =& get_instance();
}
function roleCheck($role = 'guest', $uri = '')
{
If ( $role != 'guest' ) {
$list = 'ua_role_'.$role.'_allow';
$list = $this->obj->config->item($list);
if( !empty($list) ) { $this->set_allow($list); }
$list = 'ua_role_'.$role.'_deny';
$list = $this->obj->config->item($list);
if( !empty($list) ) { $this->set_deny($list); }
}
$this->obj->session->set_flashdata('uri', $uri);
log_message('debug','roleCheck: Role = '.$role);
if(!$this->obj->userauth->check('', TRUE)) {
redirect('user/auth_error');
}
}