feat(*/README.md): re-generate for all packages

This commit is contained in:
Julien Fontanet
2020-05-28 20:56:14 +02:00
parent 53a9aa6ad2
commit 13fd9be566
94 changed files with 1708 additions and 857 deletions
+6 -24
View File
@@ -1,6 +1,10 @@
<!-- DO NOT EDIT MANUALLY, THIS FILE HAS BEEN GENERATED -->
# xo-acl-resolver [![Build Status](https://travis-ci.org/vatesfr/xen-orchestra.png?branch=master)](https://travis-ci.org/vatesfr/xen-orchestra)
> [Xen-Orchestra](http://xen-orchestra.com/) internal: do ACLs resolution.
[![Package Version](https://badgen.net/npm/v/xo-acl-resolver)](https://npmjs.org/package/xo-acl-resolver) ![License](https://badgen.net/npm/license/xo-acl-resolver) [![PackagePhobia](https://badgen.net/packagephobia/install/xo-acl-resolver)](https://packagephobia.now.sh/result?p=xo-acl-resolver)
> Xen-Orchestra internal: do ACLs resolution
## Install
@@ -42,28 +46,6 @@ if (
}
```
## Development
### Installing dependencies
```
> npm install
```
### Compilation
The sources files are watched and automatically recompiled on changes.
```
> npm run dev
```
### Tests
```
> npm run test-dev
```
## Contributions
Contributions are _very_ welcomed, either on the documentation or on
@@ -77,4 +59,4 @@ You may:
## License
ISC © [Vates SAS](https://vates.fr)
[AGPL-3.0-or-later](hhttps://spdx.org/licenses/AGPL-3.0-or-later) © [Vates SAS](https://vates.fr)
+29
View File
@@ -0,0 +1,29 @@
```js
import check from 'xo-acl-resolver'
// This object contains a list of permissions returned from
// xo-server's acl.getCurrentPermissions.
const permissions = {
/* ... */
}
// This function should returns synchronously an object from an id.
const getObject = id => {
/* ... */
}
// For a single object:
if (check(permissions, getObject, objectId, permission)) {
console.log(`${permission} set for object ${objectId}`)
}
// For multiple objects/permissions:
if (
check(permissions, getObject, [
[object1Id, permission1],
[object12d, permission2],
])
) {
console.log('all permissions checked')
}
```