derbyjs / racer

Realtime model synchronization engine for Node.js
1.19k stars 118 forks source link

Validation and authorisations through server-side `before` events? #15

Closed pygy closed 11 years ago

pygy commented 12 years ago

You could give it an API similar to on *, but with an action callback instead of the out parameter.

listener = model.before method, path, (captures..., args..., action, isLocal, passed)->
  if authorised and valid
    action null # attempt to perform the actual model request.
  else
    action "Error message"  # call call the error callback of the action without attempting the perform it.
nateps commented 11 years ago

No longer relevant in 0.5