Download the PHP package ykozhemiaka/simple-permission without Composer
On this page you can find all versions of the php package ykozhemiaka/simple-permission. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ykozhemiaka/simple-permission
More information about ykozhemiaka/simple-permission
Files in ykozhemiaka/simple-permission
Package simple-permission
Short Description Simple permission handling for PHP.
License MIT
Informations about the package simple-permission
Simple permission
Simple permission management for PHP.
Getting Started
These instructions will get you quick start for simple permission management in your PHP project.
Installation
- Require this package in the
composer.json
composer require ykozhemiaka/simple-permission
-
Before using all commands which provide this package you should init
Capsule
(for example inindex.php
where boots application) -
After required the package you should create all necessary tables.
If you've already createdusers
table you couldn't do next instruction, but if you haven'tusers
table in your database you should execute next script to create the table. -
Next, you need to create several tables that are associated with permission tables.
- If table users name isn't
users
you should set custom name inSimplePermission\Models\User.php
Quick start
Management permissions
-
Create new permission "Edit article".
-
Update created permission above.
- Delete permission by name
Or by id
-
Assign role to permission
- Revoke permission to role
Management permissions via user
-
Give permission to user.
-
Assign role to user.
-
Verify permission.
-
Verify role.
-
Revoke permission.
- Revoke role.
Management roles
-
Create role.
-
Fetch all permissions attached to role.
-
Update role.
- Delete by name
Or delete by id
-
Attach permission to role.
-
Assign role to user.
-
Revoke role to user.
- Revoke permission to user.
Built With
- illuminate/database - The Illuminate Database component is a full database toolkit for PHP.
Authors
- Yaroslav Kozhemiaka - Initial work - Yaroslav Kozhemiaka