Enforce file creation allowance via Pundit policy
This commit is contained in:
@ -15,8 +15,10 @@ module CodeOcean
|
||||
def create?
|
||||
if @record.context.is_a?(Exercise)
|
||||
admin? || author?
|
||||
else
|
||||
elsif @record.context.is_a?(Submission) and @record.context.exercise.allow_file_creation
|
||||
author?
|
||||
else
|
||||
no_one
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user