diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-12-25 18:48:26 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-12-31 14:35:57 +0900 |
commit | 8f1e96c89bd3ffe6ae47c275df2d1e919d42c39a (patch) | |
tree | 783bdd82084985736a8a07ab13d0e9f335f2fcd0 /app/policies | |
parent | dc8a8c7d998e2c1f78fcf60f8dc45b572f62abe8 (diff) | |
download | gitlab-ce-8f1e96c89bd3ffe6ae47c275df2d1e919d42c39a.tar.gz |
Add spec for Release API
Add spec for all release API - GET, POST, PUT, DELETE.
Also, fixes some minior bugs.
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/project_policy.rb | 2 | ||||
-rw-r--r-- | app/policies/release_policy.rb | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index 88cab816fe4..3146f26bed5 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -270,7 +270,7 @@ class ProjectPolicy < BasePolicy enable :update_cluster enable :admin_cluster enable :create_environment_terminal - enable :admin_release + enable :destroy_release end rule { (mirror_available & can?(:admin_project)) | admin }.enable :admin_remote_mirror diff --git a/app/policies/release_policy.rb b/app/policies/release_policy.rb new file mode 100644 index 00000000000..d7f9e5d7445 --- /dev/null +++ b/app/policies/release_policy.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +class ReleasePolicy < BasePolicy + delegate { @subject.project } +end |