Class: API::Entities::Namespace

Inherits:
NamespaceBasic show all
Defined in:
lib/api/entities/namespace.rb

Instance Method Summary collapse

Instance Method Details

#expose_members_count_with_descendants?(namespace, opts) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/api/entities/namespace.rb', line 10

def expose_members_count_with_descendants?(namespace, opts)
  namespace.kind == 'group' && Ability.allowed?(opts[:current_user], :admin_group, namespace)
end

#expose_root_repository_size?(namespace, opts) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/api/entities/namespace.rb', line 18

def expose_root_repository_size?(namespace, opts)
  namespace.kind == 'group' && Ability.allowed?(opts[:current_user], :admin_group, namespace)
end