mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-13 21:44:40 -04:00
Fixed #2458, I think.
This commit is contained in:
parent
a0057910ac
commit
dc90481a5c
1 changed files with 3 additions and 3 deletions
|
@ -22,7 +22,7 @@ fileDelete = (req, res) ->
|
|||
Grid.gfs.remove {_id: filedata._id, root: 'media'}, (err) ->
|
||||
return errors.serverError(res) if err
|
||||
return res.end()
|
||||
|
||||
|
||||
fileGet = (req, res) ->
|
||||
query = parsePathIntoQuery(req.path)
|
||||
|
||||
|
@ -48,7 +48,7 @@ fileGet = (req, res) ->
|
|||
res.setHeader('Cache-Control', 'public')
|
||||
readstream.pipe(res)
|
||||
handleStreamEnd(res, res)
|
||||
|
||||
|
||||
parsePathIntoQuery = (path) ->
|
||||
path = path[6..]
|
||||
path = decodeURI path
|
||||
|
@ -130,7 +130,7 @@ savePNG = (req, res) ->
|
|||
userCanEditFile = (user=null, file=null) ->
|
||||
# no user means 'anyone'. No file means 'any file'
|
||||
return false unless user
|
||||
return true if user.isAdmin()
|
||||
return true if user.isAdmin() or user.isArtisan()
|
||||
return false unless file
|
||||
return true if file.metadata.creator is user.id
|
||||
return false
|
||||
|
|
Loading…
Add table
Reference in a new issue