0.0.4 • Published 7 years ago

sharedb-ace-rw-control v0.0.4

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

Sharedb-ace-rw-control

npm version

Plugin for sharedb-ace, that enables access control. Specifically, it enables 2 levels: lecturer and student.

Installation

npm install sharedb-ace-rw-control

Server

import SharedbAceRWControl from 'sharedb-ace-rw-control/server';

router.get('/ws', async (ctx) => {
  const rw = SharedbAceRWControl(REDIS_URL);
  rw(ctx);
});

Client

  1. Using =node=
import SharedbAceRWControl from "sharedb-ace-rw-control/client";
const editor = ace.edit("editor"); 
const ShareAce = new sharedbAce(id, { ... });
ShareAce.on('ready', function() {
  ShareAce.add(editor, ["path"], [
    SharedbAceRWControl
  ]);
});
  1. Use CDN
https://unpkg.com/sharedb-ace-rw-control@0.0.2/dist/sharedb-ace-rw-control.client.js
0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago