Class: Types::PermissionTypes::Project

Inherits:
BasePermissionType show all
Defined in:
app/graphql/types/permission_types/project.rb

Constant Summary

Constants inherited from BasePermissionType

BasePermissionType::RESOLVING_KEYWORDS

Instance Method Summary collapse

Methods inherited from BasePermissionType

abilities, ability_field, define_field_resolver_method, permission_field

Methods included from Gitlab::Allowable

#can?, #can_all?, #can_any?

Methods inherited from BaseObject

accepts, assignable?, authorization, authorization_scopes, authorize, authorized?, #current_user, #id

Methods included from Gitlab::Graphql::Present

#present, #unpresented

Instance Method Details

#admin_all_resourcesObject



32
33
34
35
36
# File 'app/graphql/types/permission_types/project.rb', line 32

def admin_all_resources
  return false unless current_user

  current_user.can_admin_all_resources?
end

#create_snippetObject



28
29
30
# File 'app/graphql/types/permission_types/project.rb', line 28

def create_snippet
  Ability.allowed?(context[:current_user], :create_snippet, object)
end