hubfeenix.fi/app/policies/teacher_policy.rb

10 lines
160 B
Ruby

class TeacherPolicy < ApplicationPolicy
def edit?
(member == record.member) or member.admin?
end
alias :update? :edit?
alias :destroy? :edit?
end