Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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