summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorVinnie Okada <vokada@mrvinn.com>2015-01-20 20:34:09 -0700
committerVinnie Okada <vokada@mrvinn.com>2015-02-11 18:53:07 -0700
commitb0dacc8eb06615cf5d0afb1fc8d799dd64325846 (patch)
treeff0a8bec0ad9450fcd9dc8585cc8c638d2298d09 /lib/api/helpers.rb
parent04953950546300400d2d95f4c3df547c59a2b174 (diff)
downloadgitlab-ce-b0dacc8eb06615cf5d0afb1fc8d799dd64325846.tar.gz
Edit group members via API
Add an API endpoint to update the access level of an existing group member.
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 8fa30460ba6..a50ee4659a3 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -238,5 +238,10 @@ module API
def secret_token
File.read(Rails.root.join('.gitlab_shell_secret'))
end
+
+ def handle_member_errors(errors)
+ error!(errors[:access_level], 422) if errors[:access_level].any?
+ not_found!(errors)
+ end
end
end