Note: This module is universal. Functions in this module can run on both the backend and frontend, unless specified otherwise.
The Groups API provides functionality for managing groups, including creating, deleting, updating, and querying groups.
Site admins determine who can create a group. This setting can be found in your site's Dashboard under Groups Application > General Settings > Group Creation.
If set to site members with admin approval, site members can create a group using the createGroup()
function, and the group becomes a createRequest
with a name of PENDING
. The site admin either approves or rejects the request to create a group.
If set to all site members, site members can create a group using the createGroup()
function (no approval required).
If set to only admins, only site admins can create a group using the createGroup()
function.
The default is set to site members with admin approval.
When a group is created, the newly created group is added to the Groups List page of your site.
The Groups API provides functionality allowing you to:
Note: You can override the permissions below by using the wix-auth
elevate()
function.
Functions | Permissions |
---|---|
createGroup() | Manage in your site's Dashboard. Note: If you override this permission with the elevate() function, you must provide a creatorId when running the function. |
deleteGroup() , updateGroup() | Site admin, group admin. |
listGroups() , getGroup() , queryGroups() | For public & private groups: any site member. For secret groups: group members, site admin. |
Warning: Elevating a function allows it to be called by any site visitor. Exercise caution to prevent security vulnerabilities.
To use the Groups API,
import groups
from wix-groups.v2: