Skip to main content

WebAclGroupService

This service is automatically created by the WebAclService with the key webacl.group.

Actions​

The following service actions are available:

addMember​

  • Add a new member to an existing group
  • If the user is already present in the group, nothing happens.
  • If you need to add several members, repeat the request, one member at a time.
  • You need Write or Append permission on the group.
Parameters​
PropertyTypeDefaultDescription
groupUriStringrequiredURI of group
memberUriStringrequiredURI of user to be added
webIdString"anon"WebID of the logged user
Return​

Null

create​

  • Create a new group
  • Will return a 400 if the group already exists.
  • These are the permissions you will get on this new group :
    • If you created it while being logged, you will have Read, Write, Control permissions.
    • If you were not logged in, anonymous users will have Read and Write permissions.
Parameters​
PropertyTypeDefaultDescription
groupSlugStringrequiredName of the group
webIdString"anon"WebID of the logged user
Return​

String: The new group URI

getGroups​

  • Returns the list of all groups URIs you have Read access to.
  • You can then use those group URIs to give permissions to some resources to the group.
Parameters​
PropertyTypeDefaultDescription
webIdString"anon"WebID of the logged user
Return​

Array : List of all groups have you Read access to.

delete​

  • Delete the given group
  • You need Write permission on the group.
  • This will remove all members, and also will remove all permissions this group had on any resource.
Parameters​
PropertyTypeDefaultDescription
groupUriStringrequiredURI of group
webIdString"anon"WebID of the logged user

exist​

  • Check if a group already exists.
Parameters​
PropertyTypeDefaultDescription
groupUriStringrequired except if groupSlug is setURI of group
groupSlugStringrequired except if groupUri is setName of the group
webIdString"anon"WebID of the logged user

getGroups​

  • List all existing WebACL groups.
Parameters​
PropertyTypeDefaultDescription
webIdString"anon"WebID of the logged user
Return​

Array : List of groups URIs

getMembers​

  • Returns the members of the group
  • You need acl:Read permission on the group.
Parameters​
PropertyTypeDefaultDescription
groupUriStringrequired except if groupSlug is setURI of group
groupSlugStringrequired except if groupUri is setName of the group
webIdString"anon"WebID of the logged user
Return​

Array : List of members URIs

isMember​

  • Check if an user belongs to a group.
  • You need acl:Read permission on the group.
Parameters​
PropertyTypeDefaultDescription
groupUriStringrequired except if groupSlug is setURI of group
groupSlugStringrequired except if groupUri is setName of the group
memberIdStringrequiredURI of user to check
webIdString"anon"WebID of the logged user
Return​

Boolean : True if the user is a member of the group

removeMember​

  • Remove an user from a given group
  • If the user is not a member, nothing happens.
  • You need Write permission on the group.
Parameters​
PropertyTypeDefaultDescription
groupUriStringrequired except if groupSlug is setURI of group
groupSlugStringrequired except if groupUri is setName of the group
memberUriStringrequiredURI of user to be removed
webIdString"anon"WebID of the logged user

Events​

webacl.group.member-added​

Sent when an user is added to a group.

Parameters​
PropertyTypeDescription
uriStringURI of the resource on which rights were created

webacl.group.member-removed​

Sent when an user is added to a group.

Parameters​
PropertyTypeDescription
uriStringURI of the resource on which rights were updated
isContainerBooleanTrue if the resource is a container
defaultRightsUpdatedBooleanTrue if the resource is a container and some of the default rights of the container were updated

API routes​

These routes are automatically added to the api service.

RouteAction calledBody
GET /_groupswebacl.group.getGroupsNull
POST /_groupswebacl.group.createNull
GET /_groups/name_of_the_groupwebacl.group.getMembersNull
PATCH /_groups/name_of_the_groupwebacl.group.addMember{ "memberUri": "..." }
POST /_groups/name_of_the_groupwebacl.group.removeMember{ "deleteUserUri": "..." }
DELETE /_groups/name_of_the_groupwebacl.group.deleteNull

Permissions​

Groups have permissions too. You can modify those permissions by using the usual APIs with the URL in the form of /_acl/_groups/group-name.