cemleme/cmauth

cmauth laravel 5.1.11 rbac

dev-master 2015-12-03 09:39 UTC

This package is not auto-updated.

Last update: 2020-01-10 15:42:10 UTC


README

Cmauth2 is a Role Based Access Control Authentication package developed for Laravel 5.1.11 applications.
You can creating unlimited Groups (Roles) and Permissions and assign your users to Groups.

Afterwards you can use your filters and facades to check if the logged in user has proper permission for the current route / controller / method / view part.

Features:

  • Creating and managing Users, Groups (Roles) and Permissions
  • Managing login / logout / remember steps
  • Permissions checks with filters and facades
  • Option to choose different users to have passwords on the system or check credentials through LDAP
  • Cmauth admin panel to assign users and permissions to groups

Requirements:

  • Laravel 5
  • PHP ldap extension (if you require LDAP authentication)

Setup:

In the require key of composer.json file add the following

"cemleme/cmauth2": "dev-master"

Run the Composer update comand

$ composer update cemleme/cmauth

In your config/app.php add CmauthServiceProvider to the end of the providers array

'providers' => [
    ...
    'Cemleme\Cmauth\CmauthServiceProvider',
],

Assign same User model at config/auth.php

'model' => 'Cemleme\Cmauth\models\User'  //(or \App\User if you extend \Cemleme\Cmauth\models\User)

Publish config file config/cmauth.php using artisan publish command:

php artisan vendor:publish --provider="Cemleme\Cmauth\CmauthServiceProvider"

Cmauth Config File:

  • 'mastertemplate' : The template you want to wrap Cmauth admin panel. It looks for @yield('content') at the template page
  • 'loginview' => Your desired login page. Cmauth is compatible with default Laravel 5 login page. You do not need any extra fields
  • 'ldap' => Optional. Set it to true if you want to use LDAP authentication
  • 'ldap_domain' => Required if 'ldap' => true. Your LDAP domain name
  • 'ldap_server' => Required if 'ldap' => true. IP address of your LDAP server
  • 'ldap_port' => Required if 'ldap' => true. Port of your LDAP server

Used Packages:

  • For log viewer, create "ViewLog" Permission and assign it to desired user. The route is /logs
  • For laravel backup, you can publish the config file using php artisan vendor:publish --provider="Spatie\Backup\BackupServiceProvider"