本文整理汇总了TypeScript中meteor-rxjs.MongoObservable.Collection.allow方法的典型用法代码示例。如果您正苦于以下问题:TypeScript MongoObservable.Collection.allow方法的具体用法?TypeScript MongoObservable.Collection.allow怎么用?TypeScript MongoObservable.Collection.allow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类meteor-rxjs.MongoObservable.Collection
的用法示例。
在下文中一共展示了MongoObservable.Collection.allow方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: loggedIn
import { MongoObservable } from 'meteor-rxjs';
import { Meteor } from 'meteor/meteor';
import { Action } from '../models/action.model';
export const Activity = new MongoObservable.Collection<Action>('activity', {idGeneration: 'MONGO'});
function loggedIn() {
return !!Meteor.user();
}
Activity.allow({
insert: loggedIn,
update: loggedIn,
remove: loggedIn
});
示例2: loggedIn
import { MongoObservable } from 'meteor-rxjs';
import { Meteor } from 'meteor/meteor';
import { Todo } from '../models/todo.model';
export const Todos = new MongoObservable.Collection<Todo>('todos', {idGeneration: 'MONGO'});
function loggedIn() {
return !!Meteor.user();
}
Todos.allow({
insert: loggedIn,
update: loggedIn,
remove: loggedIn
});
示例3: loggedIn
import { MongoObservable } from 'meteor-rxjs';
import { Meteor } from 'meteor/meteor';
import { Entity } from '../models/entity.model';
export const Entities = new MongoObservable.Collection<Entity>('entities', {idGeneration: 'MONGO'});
function loggedIn() {
return !!Meteor.user();
}
Entities.allow({
insert: loggedIn,
update: loggedIn,
remove: loggedIn
});
示例4: loggedIn
import { MongoObservable } from 'meteor-rxjs';
import { Meteor } from 'meteor/meteor';
import { Version } from '../models/version.model';
export const Versions = new MongoObservable.Collection<Version>('versions', {idGeneration: 'MONGO'});
function loggedIn() {
return !!Meteor.user();
}
Versions.allow({
insert: function (userId, doc) {
return true;
},
update: function (userId, doc) {
return true;
},
remove: function (userId, doc) {
return true;
}
});
示例5: loggedIn
import { MongoObservable } from 'meteor-rxjs';
import { Meteor } from 'meteor/meteor';
import { PipeUser } from '../models/user.model';
export const PipeUsers = new MongoObservable.Collection<PipeUser>('pipeUsers', {idGeneration: 'MONGO'});
function loggedIn() {
return !!Meteor.user();
}
PipeUsers.allow({
insert: loggedIn,
update: loggedIn,
remove: loggedIn
});
示例6:
import { MongoObservable } from 'meteor-rxjs';
import { Meteor } from 'meteor/meteor';
import { Poem, PoemPermissions } from '../models/poem.model';
import { PoemLine } from '../models/poem-line.model';
export const Poems = new MongoObservable.Collection<Poem>('poems');
Poems.allow(PoemPermissions);