Skip to content
Snippets Groups Projects
Commit 1a3796fd authored by Diego Sampaio's avatar Diego Sampaio
Browse files

fix upload permissions introduced in raik:ufs 0.3.4

parent 27975310
No related branches found
No related tags found
No related merge requests found
......@@ -74,13 +74,11 @@ if UploadFS?
token = cookie.get('rc_token', rawCookies) if rawCookies?
unless uid and token and RocketChat.models.Users.findOneByIdAndLoginToken(uid, token)
res.statusCode = 403
res.end('Not Allowed')
# Just to abort the request
# See https://github.com/jalik/jalik-ufs/issues/28
throw new Meteor.Error 403, 'Not Allowed'
res.writeHead 403
return false
res.setHeader 'content-disposition', "attachment; filename=\"#{ encodeURIComponent(file.name) }\""
return true
Meteor.startup ->
if Meteor.isServer
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment