Added creature view and edit permissions

This commit is contained in:
Stefan Zermatten
2019-01-23 16:49:47 +02:00
parent 60dfba3b46
commit e8a0e86548
2 changed files with 56 additions and 5 deletions

View File

@@ -3,6 +3,7 @@
import { ValidatedMethod } from 'meteor/mdg:validated-method';
import SimpleSchema from 'simpl-schema';
import { canEditCreature } from '/imports/api/creature/creaturePermission.js';
import Creatures from "/imports/api/creature/Creatures.js";
import Attributes from "/imports/api/creature/properties/Attributes.js";
import Skills from "/imports/api/creature/properties/Skills.js";
@@ -10,9 +11,6 @@ import Effects from "/imports/api/creature/properties/Effects.js";
import DamageMultipliers from "/imports/api/creature/properties/DamageMultipliers.js";
import Classes from "/imports/api/creature/properties/Classes.js";
// TODO, just checks that a charId is given
const canEditCreature = charId => !!charId;
export const recomputeCreature = new ValidatedMethod({
name: "Creatures.methods.recomputeCreature",
@@ -40,8 +38,8 @@ export const recomputeCreature = new ValidatedMethod({
* distilling down effects and proficiencies into the final stats that make up
* a creature.
*
* Essentially this is a backtracking algorithm that computes stats'
* dependencies before computing stats themselves, while detecting
* Essentially this is a depth first tree traversal algorithm that computes
* stats' dependencies before computing stats themselves, while detecting
* dependency loops.
*
* At the moment it makes no effort to limit recomputation to just what was