rability:受cancancan启发的简单授权库

时间:2024-05-21 11:57:18
【文件属性】:

文件名称:rability:受cancancan启发的简单授权库

文件大小:20KB

文件格式:ZIP

更新时间:2024-05-21 11:57:18

JavaScript

稳定性 受cancancan启发的简单授权库 安装 npm install rability 用法 import { can , cannot , define , read , view } from "rability" ; const eat = ( something ) => `eat ${ something } ` ; const permission = define ( can ( [ read , view ] , "Book" ) , cannot ( eat , "Candies" ) , can ( view , [ "TV" , "YouTube" ] ) ) ; permission . readBook ( ) // true permission . viewTV ( ) // true permission . viewYouTube ( )


【文件预览】:
rability-master
----.babelrc(27B)
----rollup.config.js(732B)
----index.js(41B)
----package.json(1KB)
----test()
--------rability.js(2KB)
----package-lock.json(81KB)
----.gitignore(35B)
----README.md(478B)
----source()
--------index.js(60B)
--------actions.js(482B)
--------permissions.js(598B)

网友评论