本文整理匯總了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);