Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/teefouad/eazyl
Eazyl is a very simple ACL (Access Control List) implementation.
https://github.com/teefouad/eazyl
Last synced: 3 days 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 (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T07:44:45.000Z (almost 2 years ago)
- Last Synced: 2023-03-01T04:40:39.492Z (over 1 year 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.
[![Version](https://img.shields.io/npm/v/eazyl.svg?style=flat-square)](https://www.npmjs.com/package/eazyl)
[![License](https://img.shields.io/npm/l/eazyl.svg?style=flat-square)](https://www.npmjs.com/package/eazyl)
[![Downloads](https://img.shields.io/npm/dt/eazyl.svg?style=flat-square)](https://www.npmjs.com/package/eazyl)
![Filesize](https://img.shields.io/bundlephobia/min/eazyl.svg)
[![Build Status](https://img.shields.io/travis/teefouad/eazyl/master.svg?style=flat-square)](https://travis-ci.org/teefouad/eazyl)
![Coveralls GitHub](https://img.shields.io/coveralls/github/teefouad/eazyl.svg)
# 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