10-12-2020 05:21 AM
Hi everyone,
In the frontend of Alfresco DMS we can add a group to a site with for example role = "SiteContributor", so therefore all users within the group has access with this specific right for the site. I wasn't able to find the endpoint in the alfresco api explorer. I looked up for /sites/:id/groups or /groups/:id/sites, but I wasn't lucky. Also I tried PUT /nodes/:id with permissions, but I can't see an effect on the frontend.
Do I miss something? Could you help me please?
10-12-2020 11:58 AM
You can use this REST API to add groups to a site:
'shortname' is the shortname of the web site, 'authorityname' is the full authority name for the membership. Required parameters,
role, mandatory String, the new role name for this membership.
person object, with userName property
OR group object, with fullName property
OR authority object, with fullName property
Value | Description |
---|---|
json | The default response format |
user | The authentication access |
required | The transaction level |
argument | The format style |
Example:
POST: http://localhost:8080/alfresco/service/api/sites/test/memberships
'test', is a site short name.
JsonPayload:
{ "role" : "SiteContributor", "group" : { "fullName":"GROUP_EngineeringTeam" } }
Make sure you add 'GROUP_' prefix to the group name you want to add to the site.
You should be getting response something like:
{ "role": "SiteContributor", "authority": { "authorityType": "GROUP", "shortName": "EngineeringTeam", "fullName": "GROUP_EngineeringTeam", "displayName": "EngineeringTeam", "url": "/alfresco/service/api/groups/EngineeringTeam" }, "url": "/alfresco/service/api/sites/test/memberships/GROUP_EngineeringTeam" }
10-12-2020 11:58 AM
You can use this REST API to add groups to a site:
'shortname' is the shortname of the web site, 'authorityname' is the full authority name for the membership. Required parameters,
role, mandatory String, the new role name for this membership.
person object, with userName property
OR group object, with fullName property
OR authority object, with fullName property
Value | Description |
---|---|
json | The default response format |
user | The authentication access |
required | The transaction level |
argument | The format style |
Example:
POST: http://localhost:8080/alfresco/service/api/sites/test/memberships
'test', is a site short name.
JsonPayload:
{ "role" : "SiteContributor", "group" : { "fullName":"GROUP_EngineeringTeam" } }
Make sure you add 'GROUP_' prefix to the group name you want to add to the site.
You should be getting response something like:
{ "role": "SiteContributor", "authority": { "authorityType": "GROUP", "shortName": "EngineeringTeam", "fullName": "GROUP_EngineeringTeam", "displayName": "EngineeringTeam", "url": "/alfresco/service/api/groups/EngineeringTeam" }, "url": "/alfresco/service/api/sites/test/memberships/GROUP_EngineeringTeam" }
10-13-2020 08:47 AM
That's perfect, thank you so much for this example!
Explore our Alfresco products with the links below. Use labels to filter content by product module.