Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geggleto/psr7-permission
https://github.com/geggleto/psr7-permission
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/geggleto/psr7-permission
- Owner: geggleto
- License: mit
- Created: 2015-11-13T19:48:58.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-16T16:25:37.000Z (about 9 years ago)
- Last Synced: 2024-04-18T13:43:10.631Z (7 months ago)
- Language: PHP
- Size: 0 Bytes
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# psr7-permission
## Configuration
This Middleware checks to see if a User has permission to access a specific resource.
The Middleware makes the following assumptions:
- That you load the middleware with all of the routes the system is applied to.
- That the user's permission table is loaded into the Requests 'permission' attribute [by default]If a user attempts to access a resource they are not allowed an Exception is raised.
## Usage```php
// In Slim 3
$permission = new Geggleto\Service\Permission($container['system_routes']);
// This will add the permission middleware to the entire site.
// This is not likely what you want since non-logged in users will not be able to access anything.
$app->add($permission);```