Skip to content
/ user Public

User package for custom Nette framework by Mati-Core

Notifications You must be signed in to change notification settings

mati-core/user

Repository files navigation

Mati-Core | USER

Latest Stable Version Total Downloads Integrity check Latest Unstable Version License

Install

Comoposer command:

composer require mati-core/user

Insert next code in class BasePresenter

/**
 * @var string
 */
protected $pageRight = 'cms';

use UserPresenterAccessTrait;

Access control

Check access method:

public function checkAccess(string $rightSlug): bool

Call in presenter

$this->checkAccess('right-slug');

Call in latte

$presenter->checkAccess('right->slug');

Commands

Default init

Create "Super admin" group with full access, "Admin" group with role "Admin" and "cms" right, Super admin account

php www/index.php app:user:init <username> <password> 

Create user group

Create user group. If is first user group, then be set as default.

php www/index.php app:usergroup:create <groupname>

Create user

Create user account and associate in default user group.

php www/index.php app:user:create <username> <password> 

API

Sign In

Link

/api/v1/sign/sign-in 

Params (POST)

function (string $login, string $password): array

Return

loginStatus: bool
errorMsg: null|string

About

User package for custom Nette framework by Mati-Core

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages