2016-10-19 15:22:50 +03:00
|
|
|
import Demo, {DemoPublication, DemoMethod} from './demo.js';
|
|
|
|
import Intersect, { CollectionLink as IntersectLink } from './intersect';
|
|
|
|
import { Exposure } from 'meteor/cultofcoders:grapher';
|
|
|
|
|
|
|
|
Demo.expose({
|
|
|
|
firewall(filters, options, userId) {
|
|
|
|
Exposure.restrictFields(filters, options, ['restrictedField']);
|
|
|
|
filters.isPrivate = false;
|
|
|
|
},
|
|
|
|
maxLimit: 2,
|
|
|
|
maxDepth: 2,
|
|
|
|
restrictLinks(userId) {
|
|
|
|
return ['restrictedLink'];
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
DemoMethod.expose({
|
|
|
|
publication: false
|
|
|
|
});
|
|
|
|
|
|
|
|
DemoPublication.expose({
|
|
|
|
method: false
|
|
|
|
});
|
|
|
|
|
|
|
|
Intersect.expose({
|
|
|
|
body: {
|
|
|
|
value: 1,
|
2016-10-19 18:28:55 +03:00
|
|
|
link(userId) {
|
|
|
|
if (!userId) {
|
|
|
|
return {value: 1};
|
|
|
|
}
|
2016-10-19 15:22:50 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
IntersectLink.expose({
|
|
|
|
firewall() {
|
|
|
|
throw new Meteor.Error('I do not allow!')
|
|
|
|
}
|
|
|
|
});
|