Add user with write permission to project

How do I add a user with write permission to a project using the API? These are the docs I’ve referenced.

My project is public to the team and the team has comment only permission. I want to add specific users who then have write access. It looks like the data payload sent to the addmembersforproject endpoint only accepts a string for the “members” property and the default permission applied to those users is the level of permission that was applied to the team. In other words, since the team has comment only permission. any users added will have comment only. When I change the team to have write permission, new users added to the project have write permission. I’ve tried adding property “write_access” with a value of “full_write”, which would be in line with what is returned from a call to the project_memberships endpoint, but that didn’t work.

I could see a workaround being that I have to temporarily change the team permission while adding new users, but I don’t see how to do that programmatically.

Another workaround would be to update each user’s membership gid after they’ve been added to the project, but it doesn’t look like that kind of update is exposed in the API, either.

I believe you currently can’t do what you are trying to do with the API, but a change coming soon will allow you to. @Phil_Seeman correct?

1 Like

Hi @David_Hess1,

@Bastien_Siebman is correct: while you can’t accomplish what you want in the current API, there are changes coming literally any day now, which are explained here:

The bottom line, from my understanding, is that you’ll be able to add a user to a project with write access by doing a POST like this:

  "member": "<User or Team resource>",
  "parent": "<membership-capable resource>",
  "resource_type": "membership",
  "resource_subtype": "project_membership",
  "standard_access_level": "editor",
  "<subtype-specific fields>": "<subtype-specific values>"

This is derived from @sasha_f’s comment here in that thread.

1 Like