summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index c3eca713712..742d3760533 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -255,6 +255,18 @@ module API
authorize! :update_build, user_project
end
+ def authorize_create_release!
+ authorize! :create_release, user_project
+ end
+
+ def authorize_read_release!
+ authorize! :read_release, user_project
+ end
+
+ def authorize_update_release!
+ authorize! :update_release, user_project
+ end
+
def require_gitlab_workhorse!
unless env['HTTP_GITLAB_WORKHORSE'].present?
forbidden!('Request should be executed via GitLab Workhorse')