Skip to content

Latest commit

 

History

History
83 lines (76 loc) · 2.3 KB

File metadata and controls

83 lines (76 loc) · 2.3 KB

Configuration Multi-role

IMPORTANT: First install the official plugins as described in docs/README.md

// in your app.php
'TinyAuth' => [
    'multiRole' => true,
]
// in your AppController.php
public function initialize() {
    parent::initialize();

    $this->loadComponent('TinyAuth.Authentication');
    $this->loadComponent('TinyAuth.Authorization', [
        'autoClearCache' => true,
    ]);
}

See Authentication.md and Authorization.md for complete middleware setup instructions.

auth_allow.ini

// in config folder
; ----------------------------------------------------------
; PagesController
; ----------------------------------------------------------
Pages = display
; ----------------------------------------------------------
; UsersController
; ----------------------------------------------------------
Users = login

auth_acl.ini

// in config folder
; ----------------------------------------------------------
; RolesController
; ----------------------------------------------------------
[Roles]
* = admin
; ----------------------------------------------------------
; UsersController
; ----------------------------------------------------------
[Users]
edit, index, logout = author
* = admin
; ----------------------------------------------------------
; ArticlesController
; ----------------------------------------------------------
[Articles]
* = author, admin
; ----------------------------------------------------------
; CategoriesController
; ----------------------------------------------------------
[Categories]
* = author, admin
; ----------------------------------------------------------
; TagsController
; ----------------------------------------------------------
[Tags]
* = author, admin
; ----------------------------------------------------------
; ImagesController
; ----------------------------------------------------------
[Images]
* = author, admin
; ----------------------------------------------------------
; MenusController
; ----------------------------------------------------------
[Menus]
* = admin
; ----------------------------------------------------------
; SettingsController
; ----------------------------------------------------------
[Settings]
* = admin