gitlab-org--gitlab-foss/app/policies/repository_policy.rb
Bob Van Landuyt 967cbd0834 Enforce authorizations for non-nullable fields
This makes sure we also enforce authorizations for non-nullable
fields.

We are defining our authorizations on the unwrapped
types (Repository). But when a type like that is presented in a
non-nullable field, it's type is different (Repository!). The
non-nullable type would not have the authorization metadata.

This makes sure we check the metadata on the unwrapped type for
finding authorizations.
2019-06-21 13:00:50 +02:00

5 lines
103 B
Ruby

# frozen_string_literal: true
class RepositoryPolicy < BasePolicy
delegate { @subject.project }
end