Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2024-01-16 13:42:19 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2024-01-16 13:42:19 +0300
commit84d1bd786125c1c14a3ba5f63e38a4cc736a9027 (patch)
treef550fa965f507077e20dbb6d61a8269a99ef7107 /app/graphql/resolvers/organizations
parent3a105e36e689f7b75482236712f1a47fd5a76814 (diff)
Add latest changes from gitlab-org/gitlab@16-8-stable-eev16.8.0-rc42
Diffstat (limited to 'app/graphql/resolvers/organizations')
-rw-r--r--app/graphql/resolvers/organizations/organizations_resolver.rb19
-rw-r--r--app/graphql/resolvers/organizations/projects_resolver.rb19
2 files changed, 38 insertions, 0 deletions
diff --git a/app/graphql/resolvers/organizations/organizations_resolver.rb b/app/graphql/resolvers/organizations/organizations_resolver.rb
new file mode 100644
index 00000000000..ab21a84645b
--- /dev/null
+++ b/app/graphql/resolvers/organizations/organizations_resolver.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+module Resolvers
+ module Organizations
+ class OrganizationsResolver < BaseResolver
+ include Gitlab::Graphql::Authorize::AuthorizeResource
+
+ type Types::Organizations::OrganizationType.connection_type, null: true
+ authorize :read_organization
+
+ def resolve
+ # For the Organization MVC, all the organizations are public. We need to change this to only accessible
+ # organizations once we start supporting private organizations.
+ # See https://gitlab.com/groups/gitlab-org/-/epics/10649.
+ ::Organizations::Organization.all
+ end
+ end
+ end
+end
diff --git a/app/graphql/resolvers/organizations/projects_resolver.rb b/app/graphql/resolvers/organizations/projects_resolver.rb
new file mode 100644
index 00000000000..836fe0ae059
--- /dev/null
+++ b/app/graphql/resolvers/organizations/projects_resolver.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+module Resolvers
+ module Organizations
+ class ProjectsResolver < BaseResolver
+ include Gitlab::Graphql::Authorize::AuthorizeResource
+
+ type Types::ProjectType, null: true
+
+ authorize :read_project
+
+ alias_method :organization, :object
+
+ def resolve
+ ::ProjectsFinder.new(current_user: current_user, params: { organization: organization }).execute
+ end
+ end
+ end
+end