xanzy / go-gitlab

GitLab Go SDK
Apache License 2.0
2.37k stars 940 forks source link

Feature Request: Allow setting custom roles to users on projects #1867

Closed dfredell closed 7 months ago

dfredell commented 7 months ago

I'm a Ultimate user, and I want to take advantage of the Free Guest user accounts. My guest users need to read the source code on the repositories though. So I created a custom role based off of Guest which also has Read Code Permission, as suggested by Project members permissions, citation 23 I was able to assign a user this 'readonly' role, they could read the code, and didn't take up a Ultimate seat license. Win. Now I need to make this official and bake it into our Terraform IaC used to manage permissions on gitlab.com.

The existing group_membership resource only allows setting access_level but not member_role_id. So this Issue is to add an optional integer value member_role_id to resource gitlab_group_membership and resource gitlab_project_membership. This will bring the terrarform provider up to feature compatibility with the API.

I created a custom role in https://gitlab.com/groups/ROOT/-/settings/roles_and_permissionsI'm a Ultimate user, and I want to take advantage of the Free Guest user accounts. My guest users need to read the source code on the repositories though. So I created a custom role based off of Guest which also has Read Code Permission, as suggested by Project members permissions, citation 23 I was able to assign a user this 'readonly' role, they could read the code, and didn't take up a Ultimate seat license. Win. Now I need to make this official and bake it into our Terraform IaC used to manage permissions on gitlab.com. The existing group_membership resource only allows setting access_level but not member_role_id. So this Issue is to add an optional integer value member_role_id to resource gitlab_group_membership and resource gitlab_project_membership. This will bring the terrarform provider up to feature compatibility with the API. I created a custom role in https://gitlab.com/groups/ROOT/-/settings/roles_and_permissions

This is required to add this capability to the GitLab Terraform Provider: https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/issues/6186