Use admin? or teacher? for permission check instead of internal_user?

This commit is contained in:
Sebastian Serth
2018-11-22 18:55:54 +01:00
parent 71fd3b9b07
commit 4b251599ff
11 changed files with 22 additions and 22 deletions

View File

@ -1,6 +1,6 @@
class AdminOrAuthorPolicy < ApplicationPolicy
[:create?, :index?, :new?].each do |action|
define_method(action) { @user.internal_user? }
define_method(action) { admin? || teacher? }
end
[:destroy?, :edit?, :show?, :update?].each do |action|