Home Manual Reference Source
import {GroupManagement} from 'zetapush-js/src/mapping/services.js'
public class | source

GroupManagement

Extends:

src/mapping/core.js~Service → GroupManagement

User API for groups and rights.

Groups are stored per user. This means that two users can own a group with the same identifier. A couple (owner, group) is needed to uniquely identify a group inside a group management service. The triplet (deploymentId, owner, group) is actually needed to fully qualify a group outside of the scope of this service.

Static Member Summary

Static Public Members
public static get

Get default deployment id associated to GroupManagement service

Method Summary

Public Methods
public

addMe(objectPattern: {"group": *, "owner": *}): *

Adds me to a group

public

addUser(objectPattern: {"user": *, "group": *, "owner": *}): *

Adds a user to a group

public

addUsers(objectPattern: {"users": *, "group": *, "owner": *}): *

Adds users to a group

public

allGroups(objectPattern: {"owner": *}): *

Lists my owned groups, with details

public

createGroup(objectPattern: {"group": *, "groupName": *, "owner": *}): *

Creates a group

public

delGroup(objectPattern: {"group": *, "owner": *}): *

Removes a group

public

delUser(objectPattern: {"user": *, "group": *, "owner": *}): *

Removes a user from a group

public

delUsers(objectPattern: {"users": *, "group": *, "groupName": *, "owner": *}): *

Removes users from a group

public

exists(objectPattern: {"group": *, "owner": *}): *

Tests for a group's existence

Returns whether a group exists or not.

public

grant(objectPattern: {"resource": *, "group": *, "owner": *, "action": *}): *

Grants a right to a group

public

groupUsers(objectPattern: {"group": *, "owner": *}): *

Lists the group users

public

groups(objectPattern: {"owner": *}): *

Lists my owned groups

public

listGrants(objectPattern: {"group": *, "owner": *}): *

Lists rights for a group

public

listPresences(objectPattern: {"group": *, "owner": *}): *

Lists presences for a group

public

memberOf(objectPattern: {"hardFail": *, "group": *, "owner": *}): *

Tests membership

public

mgrant(objectPattern: {"resource": *, "actions": *, "group": *, "owner": *}): *

Grants rights to a group

public

mrevoke(objectPattern: {"resource": *, "actions": *, "group": *, "owner": *}): *

Revokes rights for a group

public

myGroups(objectPattern: {"owner": *}): *

Lists the groups I am part of

public

revoke(objectPattern: {"resource": *, "group": *, "owner": *, "action": *}): *

Revokes a right for a group

Static Public Members

public static get DEFAULT_DEPLOYMENT_ID: string: string source

Get default deployment id associated to GroupManagement service

Return:

string

Public Methods

public addMe(objectPattern: {"group": *, "owner": *}): * source

Adds me to a group

Adds me (the caller) to a group. This verb exists so that group owners may grant the right to join their groups without granting the right to add other users to those groups. The 'user' field is implicitly set to the current user's key.

Params:

NameTypeAttributeDescription
objectPattern {"group": *, "owner": *}
  • default: {"group":null,"owner":null}

Return:

*

public addUser(objectPattern: {"user": *, "group": *, "owner": *}): * source

Adds a user to a group

Adds the given user to the given group. Addition may fail if the given group does not already exist.

Params:

NameTypeAttributeDescription
objectPattern {"user": *, "group": *, "owner": *}
  • default: {"user":null,"group":null,"owner":null}

Return:

*

public addUsers(objectPattern: {"users": *, "group": *, "owner": *}): * source

Adds users to a group

Params:

NameTypeAttributeDescription
objectPattern {"users": *, "group": *, "owner": *}
  • default: {"users":null,"group":null,"owner":null}

Return:

*

public allGroups(objectPattern: {"owner": *}): * source

Lists my owned groups, with details

Returns the whole list of groups owned by the current user, with their members

Params:

NameTypeAttributeDescription
objectPattern {"owner": *}
  • default: {"owner":null}

Return:

*

public createGroup(objectPattern: {"group": *, "groupName": *, "owner": *}): * source

Creates a group

Creates a group owned by the current user. Group creation may fail if the group already exists.

Params:

NameTypeAttributeDescription
objectPattern {"group": *, "groupName": *, "owner": *}
  • default: {"group":null,"groupName":null,"owner":null}

Return:

*

public delGroup(objectPattern: {"group": *, "owner": *}): * source

Removes a group

Removes the given group owned by the current user or the given owner. Also removes all grants to that group.

Params:

NameTypeAttributeDescription
objectPattern {"group": *, "owner": *}
  • default: {"group":null,"owner":null}

Return:

*

public delUser(objectPattern: {"user": *, "group": *, "owner": *}): * source

Removes a user from a group

Params:

NameTypeAttributeDescription
objectPattern {"user": *, "group": *, "owner": *}
  • default: {"user":null,"group":null,"owner":null}

Return:

*

public delUsers(objectPattern: {"users": *, "group": *, "groupName": *, "owner": *}): * source

Removes users from a group

Params:

NameTypeAttributeDescription
objectPattern {"users": *, "group": *, "groupName": *, "owner": *}
  • default: {"users":null,"group":null,"groupName":null,"owner":null}

Return:

*

public exists(objectPattern: {"group": *, "owner": *}): * source

Tests for a group's existence

Returns whether a group exists or not.

Params:

NameTypeAttributeDescription
objectPattern {"group": *, "owner": *}
  • default: {"group":null,"owner":null}

Return:

*

public grant(objectPattern: {"resource": *, "group": *, "owner": *, "action": *}): * source

Grants a right to a group

The granting API does not do any check when storing permissions. In particular when granting rights on a verb and resource of another API, the existence of said verb and resource is not checked.

Params:

NameTypeAttributeDescription
objectPattern {"resource": *, "group": *, "owner": *, "action": *}
  • default: {"resource":null,"group":null,"owner":null,"action":null}

Return:

*

public groupUsers(objectPattern: {"group": *, "owner": *}): * source

Lists the group users

Returns the whole list of users configured inside the given group.

Params:

NameTypeAttributeDescription
objectPattern {"group": *, "owner": *}
  • default: {"group":null,"owner":null}

Return:

*

public groups(objectPattern: {"owner": *}): * source

Lists my owned groups

Returns the whole list of groups owned by the current user

Params:

NameTypeAttributeDescription
objectPattern {"owner": *}
  • default: {"owner":null}

Return:

*

public listGrants(objectPattern: {"group": *, "owner": *}): * source

Lists rights for a group

This API lists explicitly configured rights. Effective rights include configured rights, implicit rights and inherited rights.

Params:

NameTypeAttributeDescription
objectPattern {"group": *, "owner": *}
  • default: {"group":null,"owner":null}

Return:

*

public listPresences(objectPattern: {"group": *, "owner": *}): * source

Lists presences for a group

Returns the list of members of the given groups, along with their actual and current presence on the zetapush server. The current implementation does not include information about the particular devices users are connected with. If a user is connected twice with two different devices, two identical entries will be returned.

Params:

NameTypeAttributeDescription
objectPattern {"group": *, "owner": *}
  • default: {"group":null,"owner":null}

Return:

*

public memberOf(objectPattern: {"hardFail": *, "group": *, "owner": *}): * source

Tests membership

Tests whether I (the caller) am a member of the given group. This verb exists so that users can determine if they are part of a group without being granted particular rights. The 'user' field is implicitly set to the current user's key.

Params:

NameTypeAttributeDescription
objectPattern {"hardFail": *, "group": *, "owner": *}
  • default: {"hardFail":null,"group":null,"owner":null}

Return:

*

public mgrant(objectPattern: {"resource": *, "actions": *, "group": *, "owner": *}): * source

Grants rights to a group

Grant several rights at once.

Params:

NameTypeAttributeDescription
objectPattern {"resource": *, "actions": *, "group": *, "owner": *}
  • default: {"resource":null,"actions":null,"group":null,"owner":null}

Return:

*

public mrevoke(objectPattern: {"resource": *, "actions": *, "group": *, "owner": *}): * source

Revokes rights for a group

Params:

NameTypeAttributeDescription
objectPattern {"resource": *, "actions": *, "group": *, "owner": *}
  • default: {"resource":null,"actions":null,"group":null,"owner":null}

Return:

*

public myGroups(objectPattern: {"owner": *}): * source

Lists the groups I am part of

Returns the whole list of groups the current user is part of. Groups may be owned by anyone, including the current user.

Params:

NameTypeAttributeDescription
objectPattern {"owner": *}
  • default: {"owner":null}

Return:

*

public revoke(objectPattern: {"resource": *, "group": *, "owner": *, "action": *}): * source

Revokes a right for a group

Params:

NameTypeAttributeDescription
objectPattern {"resource": *, "group": *, "owner": *, "action": *}
  • default: {"resource":null,"group":null,"owner":null,"action":null}

Return:

*