Files
codeocean/app/policies/execution_environment_policy.rb

11 lines
239 B
Ruby

class ExecutionEnvironmentPolicy < AdminOnlyPolicy
def author?
@user == @record.author
end
private :author?
[:execute_command?, :shell?, :statistics?].each do |action|
define_method(action) { admin? || author? }
end
end