Skip to content

Commit

Permalink
Update app/controllers/uploaded_files_controller.rb
Browse files Browse the repository at this point in the history
Co-Authored-By: Adrian Jost <22987140+adrianjost@users.noreply.github.com>
  • Loading branch information
caustt and adrianjost authored Jan 16, 2020
1 parent 5d9a3a8 commit be7a61b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/uploaded_files_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def uploaded_file_params

def validate_destroy_rights
uploaded_file = UploadedFile.find(params[:id])
@owner = current_user == @uploaded_file.author
owner = current_user == uploaded_file.author
course_file_and_course_owner = (uploaded_file.allowsUpload.class == Course) && (uploaded_file.allowsUpload.creator_id == current_user.id)
lecture_file_and_lecture_owner = (uploaded_file.allowsUpload.class == Lecture) && (uploaded_file.allowsUpload.lecturer_id == current_user.id)
unless owner || course_file_and_course_owner || lecture_file_and_lecture_owner
Expand Down

0 comments on commit be7a61b

Please sign in to comment.