xiidea /
ezRbac
A simple yet easy to implement Role Based Access Control Library for popular PHP framework Codeigniter
47/100 healthLoading repository data…
firoz-ahmad-likhon / repository
CodeIgniter Role Base Access Control library is an easy understandable, comprehensive and convenient way to manage users.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
It is a library for CodeIgniter to manage role base access control.
Download/Clone the repository
Put all files into your project directory respectively.
Ensure the session library and auth_helper are auto loaded in config/autoload.php:
$autoload['libraries'] = array('session');
$autoload['helper'] = array('auth_helper', 'url');
You can set login as a default controller in config/route.php.
$route['default_controller'] = 'login';
Run sql file attached with this repository. The default username and password are: admin
Now you are ready to browse the application.
Add permission:
Name format: method_name-controller_name Example: if the controller name is 'roles; and 'edit' is a method then name will be 'edit-roles'
$this->Permission->add([
'name' => 'add-roles',
'display_name' => 'Create Role',
'status' => 1,
]);
Add role:
$this->Role->add([
'name' => 'editor',
'display_name' => 'editor',
'description' => 'Editor can edit and publish posts',
'status' => 1,
]);
Assign permissions with role:
$permissions will be a permission id or an array of permission id
$this->Role->addPermissions($role_id, $permissions);
Example:
$this->Role->addPermissions(1, [2, 3]);
Add User:
$this->User->add([
'name' => 'Likhon',
'username' => 'likhon',
'password' => password_hash('admin', PASSWORD_BCRYPT),,
'status' => 1,
]);
Assign roles with user:
$roles will be a role id or an array of role id
$this->User->addRoles($user_id, $roles);
Example:
$this->User->addRoles(2, [2, 3]);
Role base access control is a library that makes decision for access on the permissions. This library can handle multi roles. To enable authentication put these line in controller's construction method:
Selected from shared topics, language and repository description—not editorial ratings.
xiidea /
A simple yet easy to implement Role Based Access Control Library for popular PHP framework Codeigniter
47/100 healthCodeIgnitor 3.2 based CRUD application, used to role based User Login, Registration, Dashboard and CRUD for Manage Customers, Manage Vehicles. Advanced Bootstrap 4.0 based UI for Admin Dashboard (AdminLTE)
49/100 health$this->load->library(['auth']);
$this->auth->route_access();
If you want to authenticate only some methods of a controller then use
$this->auth->only($methods)
Uses:
$this->auth->only(['edit-posts', 'publish-posts'])
Or if you need to not check authentication for some methods then use:
$this->auth->except($methods)
Uses:
$this->auth->except(['add-posts'])
Check if current user is logged in.
check()
Check if current user has a permission by its name.
can($permissions)
Uses:
if( can('edit-posts') ) {}
if( can(['edit-posts', 'publish-posts']) ) {}
Checks if the current user has a role by its name.
hasRole($roles)
Uses
if( hasRoles(['admin', 'editor']) ) {}
if( hasRoles('subscriber') ) {}
Check login status: return true|false
$this->auth->loginStatus()
Guest user check: return true|false
$this->auth->guest()
Read authenticated user ID
$this->auth->userID()
Read authenticated user Name
$this->auth->userName()
Read authenticated user roles
$this->auth->roles()
Read authenticated user permissions
$this->auth->permissions()
Logout
$this->auth->logout()
llnancy /
一个基于角色的权限管理系统(RABC)Role Based Access Control
31/100 healthikhsan3adi /
Proyek 3 Mission 3-4: SIAKAD Mini Codeigniter 4 dengan menerapkan Authentication dan Authorization menggunakan Role-Based Access Control (RBAC)
50/100 healthmeherulsust /
User Login & Role Management System is a PHP + MySQLi powered PHP script built up under the CodeIgniter framework(version 3. x), that allows the registration and management of users with admin panel to manage them. It can be used as a base platform for any CodeIgniter projects
38/100 healthSecure CodeIgniter 4 portal for storing encrypted client credentials with client-side AES-256 encryption and role-based access.
59/100 health