Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Allow setting custom roles to users on projects #1868

Merged
merged 2 commits into from
Jan 19, 2024
Merged

Conversation

dfredell
Copy link

@dfredell dfredell commented Jan 17, 2024

@dfredell
Copy link
Author

I wired it up locally to terraform and confirmed that project and group setting of member_role_id worked.

locals {
  # Guest role w/ Read code permission
  # https://gitlab.com/groups/flywheel-io/-/settings/roles_and_permissions
  custom_role_readonly_id = 1000640
  # group ID of the readonly team users
  team_readonly_id = 81031499
}


// Create membership entries for each
resource "gitlab_group_membership" "members" {
  # for_each = local.user_group_access_map

  group_id     = local.team_readonly_id
  user_id      = 19712725
  access_level = "guest"
  member_role_id = local.custom_role_readonly_id
}

// Create membership entries for each
resource "gitlab_project_membership" "members" {
  # for_each = local.user_group_access_map

  project     = 14305943
  user_id      = 19712725
  access_level = "guest"
  member_role_id = local.custom_role_readonly_id
}

image

On a group:
image

On a project:
image

Copy link
Member

@svanharmelen svanharmelen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can update the name, I'm good with this one...

group_members.go Outdated Show resolved Hide resolved
@dfredell dfredell requested a review from svanharmelen January 18, 2024 18:51
Copy link
Member

@svanharmelen svanharmelen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dfredell 👍🏻

@svanharmelen svanharmelen merged commit 88e8a9d into xanzy:main Jan 19, 2024
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Allow setting custom roles to users on projects
2 participants