Clone wiki

tank auth with roles / Home

Tank Auth with role management (CURRENT SOURCE WORKS FOR CODEIGNITER 2.1.0 too)

added a simple role system.

2 defaults roles - "admin" and "user". Roles are in table named "roles", the default role is set to all registrations after the admin.

First registering user will be in the role "admin" and the rest will be in the user role. Also added function to check roles.

Role name is saved to the session of logged in user.

To find the role name from a role id, use $this->tank_auth->get_role_name($role_id);

To get current logged in user's role name, use $this->tank_auth->get_role();

To check if user is in specified role, use $this->tank_auth->is_role('role_name'); string passed return is boolean

for eg: $this->tank_auth->is_role('admin'); to check if current user is in admin role group.

Contact details: