Comments (1)
Try this:
ac.grant('user')
.execute('read').on('video')
.grant('admin')
.extendSync('user')
.execute('create').on('video')
.execute('update').on('video')
.execute('delete').on('video');
or
(await ac.grant('user')
.execute('read').on('video')
.grant('admin')
.extend('user'))
.execute('create').on('video')
.execute('update').on('video')
.execute('delete').on('video');
extend
is promise function so you need to user await before chaining with another execute on that, otherwise, you can use extendSync
which is a sync function.
from role-acl.
Related Issues (20)
- Cannot find module './lib' from 'index.js' HOT 2
- Retrieve condition for a resource/action HOT 5
- Need suggestion on how to support async functions for conditions HOT 1
- Action rule not working HOT 3
- Add option to make methods synchronous HOT 5
- Update documentation to reflect async functions in 4.0 HOT 4
- Support setting error messages from ACL HOT 5
- "Cannot find module 'role-acl'" - needing to refer to AccessControl class as type HOT 1
- Nested JSON path does not work. HOT 3
- Custom declarative condition Fns HOT 6
- Condition when args EQUALS null returns false, expected true. HOT 1
- Extend Role in Array HOT 8
- Support dynamic context values in the conditions using function. HOT 4
- 4.5.3 introduces type errors HOT 1
- Error CoreMongooseArray HOT 2
- Loading conflicting grants from same level. HOT 1
- AND condition does not await async custom conditions passed as args HOT 1
- Require cycle problem
- When is next version is published?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from role-acl.