summaryrefslogtreecommitdiff
path: root/app/controllers/groups
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 12:07:33 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 12:07:33 +0000
commit6b75320f525f841454f1ab162d141d3610f2e77b (patch)
tree4971c27759e4fbc18b85e71800c3b9c12346317e /app/controllers/groups
parent4226aca420920c1844e8eade4798a2dff188a6fc (diff)
downloadgitlab-ce-6b75320f525f841454f1ab162d141d3610f2e77b.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/groups')
-rw-r--r--app/controllers/groups/milestones_controller.rb2
-rw-r--r--app/controllers/groups/registry/repositories_controller.rb34
2 files changed, 35 insertions, 1 deletions
diff --git a/app/controllers/groups/milestones_controller.rb b/app/controllers/groups/milestones_controller.rb
index 1eacae06457..1e9d51cf970 100644
--- a/app/controllers/groups/milestones_controller.rb
+++ b/app/controllers/groups/milestones_controller.rb
@@ -44,7 +44,7 @@ class Groups::MilestonesController < Groups::ApplicationController
# all projects milestones states at once.
milestones, update_params = get_milestones_for_update
milestones.each do |milestone|
- Milestones::UpdateService.new(milestone.parent, current_user, update_params).execute(milestone)
+ Milestones::UpdateService.new(milestone.resource_parent, current_user, update_params).execute(milestone)
end
redirect_to milestone_path
diff --git a/app/controllers/groups/registry/repositories_controller.rb b/app/controllers/groups/registry/repositories_controller.rb
new file mode 100644
index 00000000000..39f6963ee0a
--- /dev/null
+++ b/app/controllers/groups/registry/repositories_controller.rb
@@ -0,0 +1,34 @@
+# frozen_string_literal: true
+module Groups
+ module Registry
+ class RepositoriesController < Groups::ApplicationController
+ before_action :verify_container_registry_enabled!
+ before_action :authorize_read_container_image!
+
+ def index
+ track_event(:list_repositories)
+
+ respond_to do |format|
+ format.html
+ format.json do
+ @images = group.container_repositories.with_api_entity_associations
+
+ render json: ContainerRepositoriesSerializer
+ .new(current_user: current_user)
+ .represent(@images)
+ end
+ end
+ end
+
+ private
+
+ def verify_container_registry_enabled!
+ render_404 unless Gitlab.config.registry.enabled
+ end
+
+ def authorize_read_container_image!
+ return render_404 unless can?(current_user, :read_container_image, group)
+ end
+ end
+ end
+end