diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-16 12:06:26 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-16 12:06:26 +0000 |
commit | d2798d607e11e0ebae83ae909404834388733428 (patch) | |
tree | 096b7f4d4bdb315d28cdcd4d6db4e80911112e9c /qa/qa/resource/members.rb | |
parent | d8211a0ed119eada7d292e974a8fc7b0cd982d3c (diff) | |
download | gitlab-ce-d2798d607e11e0ebae83ae909404834388733428.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/qa/resource/members.rb')
-rw-r--r-- | qa/qa/resource/members.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/qa/qa/resource/members.rb b/qa/qa/resource/members.rb new file mode 100644 index 00000000000..d70a2907523 --- /dev/null +++ b/qa/qa/resource/members.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module QA + module Resource + # + # Included in Resource::Project and Resource::Group to allow changes to + # project/group membership + # + module Members + def add_member(user, access_level = AccessLevel::DEVELOPER) + post Runtime::API::Request.new(api_client, api_members_path).url, { user_id: user.id, access_level: access_level } + end + + def api_members_path + "#{api_get_path}/members" + end + + class AccessLevel + NO_ACCESS = 0 + GUEST = 10 + REPORTER = 20 + DEVELOPER = 30 + MAINTAINER = 40 + OWNER = 50 + end + end + end +end |