mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-03-30 15:08:28 +00:00
Update ACCESS_CONTROLLERS.md
Added ipfs argument to `Identities` constructor.
This commit is contained in:
parent
d37d2c9586
commit
9a5ca21577
@ -88,7 +88,7 @@ const ipfs = await createHelia({ libp2p })
|
||||
|
||||
const orbitdb = await createOrbitDB({ ipfs })
|
||||
|
||||
const identities = await Identities()
|
||||
const identities = await Identities({ ipfs })
|
||||
const anotherIdentity = identities.createIdentity('userB')
|
||||
|
||||
const db = orbitdb.open('my-db', { AccessController: OrbitDBAccessController({ write: [orbitdb.identity.id, anotherIdentity.id]) })
|
||||
@ -103,6 +103,8 @@ Grant and revoke are not limited to 'write' access only. A custom access capabil
|
||||
|
||||
The OrbitDBAccessController is a mutable access controller. Granting and revoking access does not change the address of the database.
|
||||
|
||||
The identities are synced using IPFS, hence also the IPFS instance must passed as in `Identities({ ipfs })`.
|
||||
|
||||
## Custom Access Controller
|
||||
|
||||
Access can be customized by implementing a custom access controller. To implement a custom access controller, specify:
|
||||
@ -178,4 +180,4 @@ const ipfs = await createHelia({ libp2p })
|
||||
useAccessController(CustomAccessController)
|
||||
const orbitdb = await createOrbitDB({ ipfs })
|
||||
const db = await orbitdb.open('my-db', { AccessController: CustomAccessController(params) })
|
||||
```
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user