EazyL
Eazyl is a very simple ACL (Access Control List) implementation.
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