23 lines
643 B
JavaScript
23 lines
643 B
JavaScript
// Generated by CoffeeScript 1.3.3
|
|
|
|
module.exports.queries = function(store) {
|
|
return store.query.expose('users', 'withId', function(id) {
|
|
return this.byId(id);
|
|
});
|
|
};
|
|
|
|
module.exports.accessControl = function(store) {
|
|
store.accessControl = true;
|
|
store.readPathAccess('users.*', function(captures, next) {
|
|
var allowed;
|
|
allowed = captures === this.session.userId;
|
|
return next(allowed);
|
|
});
|
|
return store.writeAccess('*', 'users.*', function(captures, value, next) {
|
|
var allowed, pathArray;
|
|
pathArray = captures.split('.');
|
|
allowed = pathArray[0] === this.session.userId;
|
|
return next(allowed);
|
|
});
|
|
};
|