Skip to content

Commit

Permalink
Merge pull request #326 from Syncano/feat/groups-cheatsheet
Browse files Browse the repository at this point in the history
Groups cheatsheet
  • Loading branch information
jonny22094 committed Nov 17, 2018
2 parents 3040ae7 + 05017b7 commit ca69086
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions docs/cheatsheet/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,43 @@ <h4>Catching event</h4>
<pre data-type="socket"><code class="lang-yaml">event_handlers:
events.socket name.email_sent:
file: email-sent.js</code></pre>
<!--
==== Groups
-->
<h3>Groups</h3>
<p>Syncano groups</p>
<h4>Import</h4>
<pre><code class="lang-js">const {groups} = new Syncano(ctx)</code></pre>
<h4>Groups management</h4>
<pre><code class="lang-js">
// 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)
</code></pre>
<h4>Users management in groups</h4>
<pre><code class="lang-js">
//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)
</code></pre>
</section>
<!--
Expand Down

0 comments on commit ca69086

Please sign in to comment.