Skip to content

Commit

Permalink
Users with write permissions should also be allowed to check if a fil…
Browse files Browse the repository at this point in the history
…e exists in a folder
  • Loading branch information
mischa78 committed Jun 15, 2017
1 parent 1f0b184 commit c9bb944
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/files_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def destroy
def exists
@folder = Folder.find(params[:folder])

if current_user.can_read @folder
if current_user.can_read @folder || current_user.can_write @folder
@file = @folder.user_files.build(:attachment_file_name => params[:name].gsub(RESTRICTED_CHARACTERS, '_'))
render :json => !@file.valid?
end
Expand Down

0 comments on commit c9bb944

Please sign in to comment.