Files
codeocean/app/policies/internal_user_policy.rb

16 lines
249 B
Ruby

# frozen_string_literal: true
class InternalUserPolicy < AdminOnlyPolicy
def destroy?
admin? && !@record.admin?
end
def index?
admin? || teacher?
end
def show?
admin? || @record == @user || teacher_in_study_group?
end
end