API Cannot distinguish between "Everyone with access" and "Only team members" when setting a project feature's visibility level
Summary
When calling the API to set a project's feature visibility level, such as Merge Requests, Pipelines, Snippits, Issues, or Wiki, you are unable to distinguish between "Everyone with access" and "Only team members". The API only accepts a boolean value, however these settings have three possible states: "Disabled", "Only team members", and "Everyone with access".
The issue in practice
You can call the API to set the project's wiki access level:
PUT /projects/:id/wiki_enabled=true
or PUT /projects/:id/wiki_enabled=false
When calling that with wiki_enabled=true
, the project feature access level will always be set to "Everyone with access".
And as expected, when calling that with wiki_enabled=false
, the project feature access leel will always be set to "Disabled"
What should be expected
A boolean should not be used to set a property that can have three possible states.
It should be that you call PUT /projects/:id/wiki_enabled
with a string, just like you would call PUT /projects/:id/visibility
.