From 05017b7b0cc1dbbd527975537b82344a4d1ae8a6 Mon Sep 17 00:00:00 2001 From: Jan Rochalski Date: Fri, 16 Nov 2018 16:42:00 +0100 Subject: [PATCH] feat(dosc): groups cheatsheet --- docs/cheatsheet/web/index.html | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/docs/cheatsheet/web/index.html b/docs/cheatsheet/web/index.html index 0df1a94d..8e01155c 100644 --- a/docs/cheatsheet/web/index.html +++ b/docs/cheatsheet/web/index.html @@ -239,6 +239,43 @@

Catching event

event_handlers:
   events.socket name.email_sent:
     file: email-sent.js
+ +

Groups

+

Syncano groups

+

Import

+
const {groups} = new Syncano(ctx)
+

Groups management

+

+// Create group
+await groups.create(name, description)
+
+//Delete group
+await groups.delete(name)
+
+//Groups list
+await groups.list()
+
+//Get group with users list
+await groups.get(name)
+      
+

Users management in groups

+

+//Get group with users list
+await groups.get(name)
+
+//Get user groups
+await groups.user(userId)
+
+//Add user to group
+await groups.addUser(name, userId)
+
+//Remove user from group
+await groups.removeUser(name, userId)
+