mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 08:50:58 -05:00
Fixed problem POSTing UserCodeProblems for non-admins.
This commit is contained in:
parent
0d00917ca0
commit
e75e0791d0
1 changed files with 3 additions and 1 deletions
|
@ -25,7 +25,9 @@ class UserCodeProblemHandler extends Handler
|
|||
ucp
|
||||
|
||||
hasAccess: (req) ->
|
||||
req.user?.isAdmin() or false
|
||||
return true if req.user?.isAdmin()
|
||||
return true if req.method.toLowerCase() is 'post'
|
||||
false
|
||||
|
||||
getByRelationship: (req, res, args...) ->
|
||||
return @sendForbiddenError res unless @hasAccess req
|
||||
|
|
Loading…
Reference in a new issue