patrickhulce / klay

Extensible data modeling and validation library for JavaScript.
MIT License
2 stars 0 forks source link

rethink router authorization passing #74

Closed patrickhulce closed 6 years ago

patrickhulce commented 6 years ago

right now auth scopes/criteria are passed to actions through router readAuthorization and writeAuthorization which feels a little wrong, it makes a little more sense to live on the ActionRouterExtension but this would require adding a new copy of the extension for every model which is annoying when build is called separately for each already.

patrickhulce commented 6 years ago

idea: these are really properties of a model, extend klay with .authorization({action: 'read', permission: 'user:read', criteria: [['orgId']]})

patrickhulce commented 6 years ago

closed by 84b9ea8867a542e011e42dd1c7a0c4915d2a72c0