Files
codeocean/app/policies/execution_environment_policy.rb
2015-10-29 14:19:31 +01:00

11 lines
243 B
Ruby

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