diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2018-12-13 12:08:53 +0100 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-12-31 12:05:56 +0900 |
commit | 1ea2d9faa518f6b769b05a71a1f93b4ea0226bc1 (patch) | |
tree | 291cd8d7a6c6113e75219dc873e24fb414df119d /app/policies | |
parent | c07bf1abf2a5c3751e575ee5926e9a052fa0b341 (diff) | |
download | gitlab-ce-1ea2d9faa518f6b769b05a71a1f93b4ea0226bc1.tar.gz |
Add releases API
This commit introduces Releases API under /api/v4/projects/:id/releases
* We are introducing release policies at project level.
* We are deprecating releases changes from tags, both api and web
interface.
* Tags::CreateService no longer create a release
This feature is controlled by :releases_page feature flag
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/project_policy.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index bcbd9676f2e..88cab816fe4 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -23,6 +23,7 @@ class ProjectPolicy < BasePolicy container_image pages cluster + release ].freeze desc "User is a project owner" @@ -173,6 +174,7 @@ class ProjectPolicy < BasePolicy enable :read_cycle_analytics enable :award_emoji enable :read_pages_content + enable :read_release end # These abilities are not allowed to admins that are not members of the project, @@ -239,6 +241,8 @@ class ProjectPolicy < BasePolicy enable :update_container_image enable :create_environment enable :create_deployment + enable :create_release + enable :update_release end rule { can?(:maintainer_access) }.policy do @@ -266,6 +270,7 @@ class ProjectPolicy < BasePolicy enable :update_cluster enable :admin_cluster enable :create_environment_terminal + enable :admin_release end rule { (mirror_available & can?(:admin_project)) | admin }.enable :admin_remote_mirror @@ -325,6 +330,7 @@ class ProjectPolicy < BasePolicy prevent :download_code prevent :fork_project prevent :read_commit_status + prevent(*create_read_update_admin_destroy(:release)) end rule { container_registry_disabled }.policy do @@ -354,6 +360,7 @@ class ProjectPolicy < BasePolicy enable :read_commit_status enable :read_container_image enable :download_code + enable :read_release enable :download_wiki_code enable :read_cycle_analytics enable :read_pages_content |