11 lines
239 B
Ruby
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
|