https://github.com/teefouad/eazyl
Eazyl is a very simple ACL (Access Control List) implementation.
https://github.com/teefouad/eazyl
Last synced: 4 months ago
JSON representation
Eazyl is a very simple ACL (Access Control List) implementation.
- Host: GitHub
- URL: https://github.com/teefouad/eazyl
- Owner: teefouad
- License: mit
- Created: 2019-08-21T12:04:36.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T07:44:45.000Z (over 2 years ago)
- Last Synced: 2025-01-10T09:10:35.068Z (6 months ago)
- Language: JavaScript
- Size: 2.09 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EazyL
Eazyl is a very simple ACL (Access Control List) implementation.
[](https://www.npmjs.com/package/eazyl)
[](https://www.npmjs.com/package/eazyl)
[](https://www.npmjs.com/package/eazyl)

[](https://travis-ci.org/teefouad/eazyl)

# Installation
**Install with npm**
```
npm install --save eazyl
```**Install with yarn**
```
yarn add eazyl
```
# Usage
Simply:
```
import createRole, { checkIf } from 'eazyl';createRole('people').can('eat')('food');
checkIf('people').can('eat')('food'); // true
checkIf('people').can('have')('wings'); // false
```Conditionally:
```
import { a, checkIf } from 'eazyl';a('person').can('buy')('phone').when(phone => phone.price < 800);
const iPhone = {
model: 'x-tra x-pensive',
price: 2999,
};checkIf('person').can('buy')('phone').with(iPhone); // false
```
# License
MIT