mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
19 lines
564 B
JavaScript
19 lines
564 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.readPathAccess('users.*', function(userId, accept) {
|
|
console.log(accept, 'read.accept');
|
|
return accept(userId === this.session.userId);
|
|
});
|
|
return store.writeAccess('*', 'users.*', function(mutator, userId, accept) {
|
|
console.log(accept, 'write.accept');
|
|
return accept(userId === this.session.userId);
|
|
});
|
|
};
|