當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript MongoObservable.Collection.allow方法代碼示例

本文整理匯總了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
});
開發者ID:michaelb-01,項目名稱:pipe,代碼行數:16,代碼來源:activity.collection.ts

示例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
});
開發者ID:michaelb-01,項目名稱:pipe,代碼行數:16,代碼來源:todos.collection.ts

示例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
});
開發者ID:michaelb-01,項目名稱:pipe,代碼行數:16,代碼來源:entities.collection.ts

示例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;
  }
});




開發者ID:michaelb-01,項目名稱:pipe,代碼行數:22,代碼來源:versions.collection.ts

示例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
});
開發者ID:michaelb-01,項目名稱:pipe,代碼行數:16,代碼來源:users.collection.ts

示例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);
開發者ID:babyshoes,項目名稱:exquisite-corpus,代碼行數:9,代碼來源:poems.collection.ts


注:本文中的meteor-rxjs.MongoObservable.Collection.allow方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。