Skip to content

Commit

Permalink
purchase tokens accessControl bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lefnire committed Mar 3, 2013
1 parent cc4d1b2 commit 69c8d78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/server/store.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ userAccess = (store) ->

oldBalance = @session.req?._racerModel?.get("users.#{id}.balance") || 0
purchasingSomethingOnClient = newBalance < oldBalance
accept(purchasingSomethingOnClient or @session.req?._isServer)
accept(purchasingSomethingOnClient or derbyAuth.isServer(@))

store.writeAccess "*", "users.*.flags.ads", -> # captures, value, accept, err ->
accept = arguments[arguments.length - 2]
err = arguments[arguments.length - 1]
# return err(derbyAuth.SESSION_INVALIDATED_ERROR) if derbyAuth.bustedSession(@)
return accept(false) if derbyAuth.bustedSession(@)
Expand Down

0 comments on commit 69c8d78

Please sign in to comment.