rename /rpg-docs to /app
This commit is contained in:
11
app/client/globalHelpers/canEditCharacter.js
Normal file
11
app/client/globalHelpers/canEditCharacter.js
Normal file
@@ -0,0 +1,11 @@
|
||||
Template.registerHelper("canEditCharacter", function(charId) {
|
||||
return canEditCharacter(charId);
|
||||
});
|
||||
|
||||
canEditCharacter = function(charId) {
|
||||
var char = Characters.findOne(charId);
|
||||
if (!char) return false;
|
||||
var userId = Meteor.userId();
|
||||
return char.owner === userId ||
|
||||
_.contains(char.writers, userId);
|
||||
};
|
||||
Reference in New Issue
Block a user