\Roles_Model

Summary

Methods
Properties
Constants
__construct()
get_role_id()
get_privileges()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct() 

Class Constructor

get_role_id()

get_role_id(string  $role_slug) : integer

Get the record id of a particular role.

Parameters

string $role_slug

The selected role slug. Slugs are defined in the "application/config/constants.php" file.

Returns

integer —

Returns the database id of the roles record.

get_privileges()

get_privileges(string  $slug) : array

Returns all the privileges (bool values) of a role slug.

The privilege numbers are converted into bool values of the four main actions (view, add, edit, delete). By checking each value you can know if the user is able to perform this action.

Parameters

string $slug

The role slug.

Returns

array —

Returns the privilege value.