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

Commit

Permalink
Merge pull request #1868 from dfredell/main
Browse files Browse the repository at this point in the history
Allow setting custom roles to users on projects
  • Loading branch information
svanharmelen authored Jan 19, 2024
2 parents 63caa48 + 7af6bec commit 88e8a9d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions group_members.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ func (s *GroupsService) ListAllGroupMembers(gid interface{}, opt *ListGroupMembe
// GitLab API docs:
// https://docs.gitlab.com/ee/api/members.html#add-a-member-to-a-group-or-project
type AddGroupMemberOptions struct {
UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"`
AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"`
ExpiresAt *string `url:"expires_at,omitempty" json:"expires_at"`
UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"`
AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"`
ExpiresAt *string `url:"expires_at,omitempty" json:"expires_at"`
MemberRoleID *int `url:"member_role_id,omitempty" json:"member_role_id,omitempty"`
}

// GetGroupMember gets a member of a group.
Expand Down Expand Up @@ -305,8 +306,9 @@ func (s *GroupMembersService) DeleteShareWithGroup(gid interface{}, groupID int,
// GitLab API docs:
// https://docs.gitlab.com/ee/api/members.html#edit-a-member-of-a-group-or-project
type EditGroupMemberOptions struct {
AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"`
ExpiresAt *string `url:"expires_at,omitempty" json:"expires_at,omitempty"`
AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"`
ExpiresAt *string `url:"expires_at,omitempty" json:"expires_at,omitempty"`
MemberRoleID *int `url:"member_role_id,omitempty" json:"member_role_id,omitempty"`
}

// EditGroupMember updates a member of a group.
Expand Down
12 changes: 7 additions & 5 deletions project_members.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,10 @@ func (s *ProjectMembersService) GetInheritedProjectMember(pid interface{}, user
// GitLab API docs:
// https://docs.gitlab.com/ee/api/members.html#add-a-member-to-a-group-or-project
type AddProjectMemberOptions struct {
UserID interface{} `url:"user_id,omitempty" json:"user_id,omitempty"`
AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"`
ExpiresAt *string `url:"expires_at,omitempty" json:"expires_at"`
UserID interface{} `url:"user_id,omitempty" json:"user_id,omitempty"`
AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"`
ExpiresAt *string `url:"expires_at,omitempty" json:"expires_at"`
MemberRoleID *int `url:"member_role_id,omitempty" json:"member_role_id,omitempty"`
}

// AddProjectMember adds a user to a project team. This is an idempotent
Expand Down Expand Up @@ -187,8 +188,9 @@ func (s *ProjectMembersService) AddProjectMember(pid interface{}, opt *AddProjec
// GitLab API docs:
// https://docs.gitlab.com/ee/api/members.html#edit-a-member-of-a-group-or-project
type EditProjectMemberOptions struct {
AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"`
ExpiresAt *string `url:"expires_at,omitempty" json:"expires_at,omitempty"`
AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"`
ExpiresAt *string `url:"expires_at,omitempty" json:"expires_at,omitempty"`
MemberRoleID *int `url:"member_role_id,omitempty" json:"member_role_id,omitempty"`
}

// EditProjectMember updates a project team member to a specified access level..
Expand Down

0 comments on commit 88e8a9d

Please sign in to comment.