accesscontrol-re
Advanced tools
Comparing version 1.0.1 to 2.0.0
import { AccessControl, IAccessInfo } from 'accesscontrol'; | ||
export declare class AcccessControlRe { | ||
export declare class AccessControlRe { | ||
private accessInfos; | ||
@@ -4,0 +4,0 @@ addAccessInfo: (accessInfo: IAccessInfo | IAccessInfo[]) => void; |
@@ -8,3 +8,3 @@ "use strict"; | ||
const crudActions = [...enums_1.actions]; | ||
class AcccessControlRe { | ||
class AccessControlRe { | ||
constructor() { | ||
@@ -15,3 +15,5 @@ this.accessInfos = []; | ||
throw new Error(`Invalid accessInfo:\n${JSON.stringify(accessInfo)}`); | ||
_.isArray(accessInfo) ? this.accessInfos.push(...accessInfo) : this.accessInfos.push(accessInfo); | ||
_.isArray(accessInfo) | ||
? this.accessInfos.push(...accessInfo) | ||
: this.accessInfos.push(accessInfo); | ||
}; | ||
@@ -63,4 +65,4 @@ this.build = _.once(() => { | ||
} | ||
exports.AcccessControlRe = AcccessControlRe; | ||
exports.AccessControlRe = AccessControlRe; | ||
exports.cleanStarEtc = _.flow(_f.flatten, _f.remove(_f.isEqual('*')), _f.uniq, _f.sortBy(_f.identity)); | ||
//# sourceMappingURL=accesscontrol-re.js.map |
@@ -1,1 +0,1 @@ | ||
export { AcccessControlRe } from './accesscontrol-re'; | ||
export { AccessControlRe } from './accesscontrol-re'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var accesscontrol_re_1 = require("./accesscontrol-re"); | ||
exports.AcccessControlRe = accesscontrol_re_1.AcccessControlRe; | ||
exports.AccessControlRe = accesscontrol_re_1.AccessControlRe; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "accesscontrol-re", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"main": "./build/src/index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -1,2 +0,2 @@ | ||
# Access Control Re | ||
# Access Control Re v2.0.0 | ||
@@ -43,3 +43,3 @@ A facade enhancing the great javascript [Access Control](https://onury.io/accesscontrol), but with much desired missing features! | ||
import { AcccessControlRe } from '../../src'; | ||
import { AcccessControlRe } from 'accesscontrol-re';; | ||
import { AccessControl, Access, IAccessInfo } from 'accesscontrol'; | ||
@@ -56,3 +56,3 @@ | ||
const acre = new AcccessControlRe(); | ||
const acre = new AccessControlRe(); | ||
acre.addAccessInfo(accessInfos); // also accepts a single IAccessInfo | ||
@@ -72,3 +72,3 @@ const ac: AccessControl = acre.build(); // can call only `_.once` pre instance! | ||
- Only the `.grant(accessInfo: IAccessInfo)` (implicitly and only through `AcccessControlRe::addAccessInfo(accessInfo: IAccessInfo)`) and `ac.permission(queryInfo: IQueryInfo)` are supported for now, not the chained fluent methods like `createAny` & `updateOwn` or the `grantsObject` etc. The upside of this is that you can do anything without just those, and they are cleaner and easier to use for DB or bulk creation & querying of permissions than the fluent ones. | ||
- Only the `.grant(accessInfo: IAccessInfo)` (implicitly and only through `AccessControlRe::addAccessInfo(accessInfo: IAccessInfo)`) and `ac.permission(queryInfo: IQueryInfo)` are supported for now, not the chained fluent methods like `createAny` & `updateOwn` or the `grantsObject` etc. The upside of this is that you can do anything without just those, and they are cleaner and easier to use for DB or bulk creation & querying of permissions than the fluent ones. | ||
This problem could be solved with an ES6 Proxy, but I wont even bother :-) | ||
@@ -75,0 +75,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
15081
114