CLOSER-Cohorts/archivist

View on GitHub
app/policies/instrument_policy.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

class InstrumentPolicy < ApplicationPolicy
  class Scope < Scope
    def resolve
      return scope.none if user.nil?
      if user.group.study == '*'
        scope.all
      else
        scope.where(study: user.group.study)
      end
    end
  end
end