kicaj/auth

CakePHP completly Auth plugin with simple authentication and authorization

Installs: 201

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:cakephp-plugin

dev-master 2021-10-27 20:57 UTC

This package is auto-updated.

Last update: 2024-03-28 02:50:26 UTC


README

NOTE: It's still in development mode, do not use in production yet!

Requirements

It is developed for CakePHP min. 4.3.

Installation

You can install plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require kicaj/auth dev-master

Load the Plugin

Load the Plugin in your bootstrap.php or /src/Application.php:

$this->addPlugin('Auth');

Load the Component

Load the Component in your AppController.php:

public function initialize()
{
    parent::initialize();

    // ...
    $this->loadComponent('Auth.Authentication');
    // ...
}

Configuration

Nextly, you should set authorization action list for each controller by auth property, like below:

public $auth = [
    'admin' => [
        'add',
        'edit',
        'delete',
    ],
    '*' => [
        'view'
    ],
];

Load default data

If you want load default user and group data, just run command below: cake bake migrations seed -p Auth