Managing Permissions
type InviteLevel = 'read' | 'write' | 'admin' | 'block'
// 'admin' allows read + write + admin
// 'write' allows read + write
// 'read' allows only read
These can only be done by the Tome owner.
store.setPermissions(permissions: Perm)
Params: the new
permissions
to set.Returns:
Promise<void>
Update a store's permissions after initialization.
// store is one of: KeyValueStore, LogStore, or FeedStore
await store.setPermissions({
read: 'our',
write: 'our'
admin: 'our'
})
store.inviteShip(ship: string, level: InviteLevel)
Params: the
ship
to set permissions for and the level
to set to.Returns:
Promise<void>
Set permissions for a specific ship. Invites take precedence over bucket-level permissions.
// store is one of: KeyValueStore, LogStore, or FeedStore
await store.inviteShip('timluc-miptev', 'admin')
store.blockShip(ship: string)
Params: the
ship
to block.Returns:
Promise<void>
An alias for
inviteShip(ship, 'block')
.await store.blockShip('sorreg-namtyv')
Last modified 3mo ago