Group/Methods

Group/Methods

Source:

Methods for creating and managing admin user permission groups. Run these methods using Meteor.call().

Example

Meteor.call("group/createGroup", sampleCustomerGroup, shop._id)

Methods

(static) group/createGroup(groupData, shopId) → {Object}

Creates a new permission group for a shop It creates permission group for a given shop with passed in roles

Source:
Parameters:
Name Type Description
groupData Object

info about group to create

Properties
Name Type Description
name String

name of the group to be created

description String

Optional description of the group to be created

permissions Array

permissions to assign to the group being created

shopId String

id of the shop the group belongs to

Returns:
  • object.status of 200 on success or Error object on failure
Type
Object

(static) group/updateGroup(groupId, newGroupData, shopId) → {Object}

Updates a permission group for a shop. Change the details of a group (name, desc, permissions etc) to the values passed in. It also goes into affected user data to modify both the groupName (using Accounts schema) and group permissions (using "accounts/removeUserPermissions")

Source:
Parameters:
Name Type Description
groupId Object

group to be updated

newGroupData Object

updated group info (similar to current group data) slug remains untouched; used as key in querying

shopId String

id of the shop the group belongs to

Returns:
  • object.status of 200 on success or Error object on failure
Type
Object