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?
Solved! Go to Solution.
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" }
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" }
That's perfect, thank you so much for this example!
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.