Skip to content

Latest commit

 

History

History
76 lines (72 loc) · 1.97 KB

Multi-role.md

File metadata and controls

76 lines (72 loc) · 1.97 KB

Configuration Multi-role

// in your app.php
'TinyAuth' => [
    'multiRole' => true,
]
// in your AppController.php
$this->loadComponent('TinyAuth.Auth', [
    'autoClearCache' => true,
    'authorize' => ['TinyAuth.Tiny'],
    ...
]);

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