Updated useraccounts, character settings to Polymer 1

This commit is contained in:
Stefan Zermatten
2017-01-19 15:43:48 +02:00
parent 137a94f251
commit c4a488a176
81 changed files with 570 additions and 2019 deletions

View File

@@ -5,6 +5,7 @@ Meteor.methods({
charId,
{fields: {owner: 1, writers: 1}}
);
if (!char) return true;
return (userId && char.owner === userId || _.contains(char.writers, userId));
},
});
@@ -30,6 +31,7 @@ CHARACTER_SUBSCHEMA_ALLOW = {
doc.charId,
{fields: {owner: 1, writers: 1}}
);
if (!char) return true;
return userId && char.owner === userId || _.contains(char.writers, userId);
},
fetch: ["charId"],

View File

@@ -14,31 +14,42 @@ AccountsTemplates.configure({
showAddRemoveServices: true,
showForgotPasswordLink: true,
showResendVerificationEmailLink: true,
texts: {
resendVerificationEmailLink_link: "Resend email verification",
},
});
AccountsTemplates.configureRoute("changePwd", {
template: "titledAtForm",
layoutTemplate: 'layout',
});
AccountsTemplates.configureRoute("enrollAccount", {
template: "titledAtForm",
layoutTemplate: 'layout',
});
AccountsTemplates.configureRoute("forgotPwd", {
template: "titledAtForm",
layoutTemplate: 'layout',
});
AccountsTemplates.configureRoute("resetPwd", {
template: "titledAtForm",
layoutTemplate: 'layout',
});
AccountsTemplates.configureRoute("signIn", {
template: "titledAtForm",
layoutTemplate: 'layout',
});
AccountsTemplates.configureRoute("signUp", {
template: "titledAtForm",
layoutTemplate: 'layout',
});
AccountsTemplates.configureRoute("verifyEmail", {
template: "titledAtForm",
layoutTemplate: 'layout',
});
AccountsTemplates.configureRoute("resendVerificationEmail", {
template: "titledAtForm",
layoutTemplate: 'layout',
});
if (Meteor.isServer){

View File

@@ -1,7 +1,7 @@
canEditCharacter = function(charId, userId){
userId = userId || Meteor.userId();
var char = Characters.findOne(charId, {fields: {owner: 1, writers: 1}});
if (!char) return false;
if (!char) return true;
return (userId === char.owner || _.contains(char.writers, userId));
};
@@ -11,7 +11,7 @@ canViewCharacter = function(charId, userId){
charId,
{fields: {owner: 1, writers: 1, readers: 1}}
);
if (!char) return false;
if (!char) return true;
return userId === char.owner ||
_.contains(char.writers, userId) ||
_.contains(char.readers, userId);