mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
31 lines
862 B
JavaScript
31 lines
862 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() {
|
|
var captures, next;
|
|
if (!(this.session && this.session.userId)) {
|
|
return;
|
|
}
|
|
captures = arguments[0];
|
|
next = arguments[arguments.length - 1];
|
|
return next(captures === this.session.userId);
|
|
});
|
|
return store.writeAccess('*', 'users.*', function() {
|
|
var captures, next, pathArray;
|
|
if (!(this.session && this.session.userId)) {
|
|
return;
|
|
}
|
|
captures = arguments[0];
|
|
next = arguments[arguments.length - 1];
|
|
pathArray = captures.split('.');
|
|
return next(pathArray[0] === this.session.userId);
|
|
});
|
|
};
|