summaryrefslogtreecommitdiff
path: root/app/policies/group_policy.rb
diff options
context:
space:
mode:
authorAlessio Caiazza <acaiazza@gitlab.com>2019-08-22 22:08:28 +0000
committerMayra Cabrera <mcabrera@gitlab.com>2019-08-22 22:08:28 +0000
commit606a1d2d31aff69ddabe7e3794f61f3e778da3e8 (patch)
treebfaee792fd551070a3581c77bc52164610f03b2a /app/policies/group_policy.rb
parentc65ea080ba8637f0e83ea97b091e4ab3ebbce635 (diff)
downloadgitlab-ce-606a1d2d31aff69ddabe7e3794f61f3e778da3e8.tar.gz
Expose namespace storage statistics with GraphQL
Root namespaces have storage statistics. This commit allows namespace owners to get those stats via GraphQL queries like the following one { namespace(fullPath: "a_namespace_path") { rootStorageStatistics { storageSize repositorySize lfsObjectsSize buildArtifactsSize packagesSize wikiSize } } }
Diffstat (limited to 'app/policies/group_policy.rb')
-rw-r--r--app/policies/group_policy.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/policies/group_policy.rb b/app/policies/group_policy.rb
index c686e7763bb..5d2b74b17a2 100644
--- a/app/policies/group_policy.rb
+++ b/app/policies/group_policy.rb
@@ -124,6 +124,8 @@ class GroupPolicy < BasePolicy
rule { developer & developer_maintainer_access }.enable :create_projects
rule { create_projects_disabled }.prevent :create_projects
+ rule { owner | admin }.enable :read_statistics
+
def access_level
return GroupMember::NO_ACCESS if @user.nil?