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