Fix tests and slightly refactor some policies

This commit is contained in:
Sebastian Serth
2018-11-30 15:44:45 +01:00
parent 2125fb1c1d
commit 3665058435
14 changed files with 19 additions and 64 deletions

View File

@ -1,9 +1,9 @@
class ExecutionEnvironmentPolicy < AdminOnlyPolicy
[:execute_command?, :shell?, :statistics?].each do |action|
[:execute_command?, :shell?, :statistics?, :show?].each do |action|
define_method(action) { admin? || author? }
end
[:show?, :index?, :new?].each do |action|
[:index?].each do |action|
define_method(action) { admin? || teacher? }
end
end