
This adds a button to the execution environment index page that, when clicked, causes all execution environments to be synchronized to the runner management (Poseidon) by creating or replacing them. CodeOcean does not synchronize it's execution environments on startup or when a new runner management configuration is used for the first time. The administrator has to manually start this process by pressing this button. The equivalent for syncing just one execution environment is updating it.
16 lines
343 B
Ruby
16 lines
343 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 synchronize_all_to_poseidon?
|
|
admin?
|
|
end
|
|
end
|