Codeigniter中的用户角色和权限

I am developing an application with module based codeigniter. Now I want to add user roles and permission. What is the standard way of giving permission to the user ?

You can simply use sessions to keep user roles and permission. eg :

$_SESSION['user_role'] = 'Administrator';
$_SESSION['user_permission'] = 'Access denied';

As far as I know, Codeigniter does not provide a built-in library to handle UAC and permissions natively, instead you may resort to utilizing one of many externally available libraries that provide this sort of functionality to CI or write your own logic instead.

Take a look at this answer to a similar thread by @jondavidjohn suggesting the use of Ion_Auth which may provide you with the functionality that you require along with a link to a an excellent writeup detailing the use of the library: https://stackoverflow.com/a/4978714/4162264