16 lines
345 B
Ruby
16 lines
345 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ExecutionEnvironmentPolicy < AdminOnlyPolicy
|
|
%i[execute_command? shell? statistics? show?].each do |action|
|
|
define_method(action) { admin? || author? }
|
|
end
|
|
|
|
[:index?].each do |action|
|
|
define_method(action) { admin? || teacher? }
|
|
end
|
|
|
|
def sync_all_to_runner_management?
|
|
admin?
|
|
end
|
|
end
|