Began implementing useraccounts and permissions properly
This commit is contained in:
@@ -20,3 +20,7 @@ mike:mocha
|
|||||||
dburles:mongo-collection-instances
|
dburles:mongo-collection-instances
|
||||||
percolate:migrations
|
percolate:migrations
|
||||||
ecwyne:mathjs
|
ecwyne:mathjs
|
||||||
|
useraccounts:polymer
|
||||||
|
accounts-google
|
||||||
|
splendido:accounts-meld
|
||||||
|
email
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
accounts-base@1.2.0
|
accounts-base@1.2.0
|
||||||
|
accounts-google@1.0.4
|
||||||
|
accounts-oauth@1.1.5
|
||||||
accounts-password@1.1.1
|
accounts-password@1.1.1
|
||||||
accounts-ui@1.1.5
|
accounts-ui@1.1.5
|
||||||
accounts-ui-unstyled@1.1.7
|
accounts-ui-unstyled@1.1.7
|
||||||
@@ -24,6 +26,7 @@ ejson@1.0.6
|
|||||||
email@1.0.6
|
email@1.0.6
|
||||||
fastclick@1.0.3
|
fastclick@1.0.3
|
||||||
geojson-utils@1.0.3
|
geojson-utils@1.0.3
|
||||||
|
google@1.1.5
|
||||||
html-tools@1.0.4
|
html-tools@1.0.4
|
||||||
htmljs@1.0.4
|
htmljs@1.0.4
|
||||||
http@1.1.0
|
http@1.1.0
|
||||||
@@ -54,6 +57,8 @@ mobile-status-bar@1.0.3
|
|||||||
momentjs:moment@2.10.3
|
momentjs:moment@2.10.3
|
||||||
mongo@1.1.0
|
mongo@1.1.0
|
||||||
npm-bcrypt@0.7.8_2
|
npm-bcrypt@0.7.8_2
|
||||||
|
oauth@1.1.4
|
||||||
|
oauth2@1.1.3
|
||||||
observe-sequence@1.0.6
|
observe-sequence@1.0.6
|
||||||
ordered-dict@1.0.3
|
ordered-dict@1.0.3
|
||||||
package-version-parser@3.0.3
|
package-version-parser@3.0.3
|
||||||
@@ -72,14 +77,19 @@ sanjo:meteor-version@1.0.0
|
|||||||
service-configuration@1.0.4
|
service-configuration@1.0.4
|
||||||
session@1.1.0
|
session@1.1.0
|
||||||
sha@1.0.3
|
sha@1.0.3
|
||||||
|
softwarerero:accounts-t9n@1.0.9
|
||||||
spacebars@1.0.6
|
spacebars@1.0.6
|
||||||
spacebars-compiler@1.0.6
|
spacebars-compiler@1.0.6
|
||||||
|
splendido:accounts-emails-field@1.2.0
|
||||||
|
splendido:accounts-meld@1.3.0
|
||||||
srp@1.0.3
|
srp@1.0.3
|
||||||
templating@1.1.1
|
templating@1.1.1
|
||||||
tracker@1.0.7
|
tracker@1.0.7
|
||||||
ui@1.0.6
|
ui@1.0.6
|
||||||
underscore@1.0.3
|
underscore@1.0.3
|
||||||
url@1.0.4
|
url@1.0.4
|
||||||
|
useraccounts:core@1.9.1
|
||||||
|
useraccounts:polymer@1.9.1
|
||||||
velocity:chokidar@0.12.6_1
|
velocity:chokidar@0.12.6_1
|
||||||
velocity:core@0.6.0
|
velocity:core@0.6.0
|
||||||
velocity:html-reporter@0.5.3
|
velocity:html-reporter@0.5.3
|
||||||
|
|||||||
@@ -3,6 +3,12 @@ Router.configure({
|
|||||||
layoutTemplate: "layout",
|
layoutTemplate: "layout",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Router.plugin("ensureSignedIn", {
|
||||||
|
except: ["home", "atSignIn", "atSignUp", "atForgotPassword", "notFound"]
|
||||||
|
});
|
||||||
|
|
||||||
|
Router.plugin("dataNotFound", {notFoundTemplate: "notFound"});
|
||||||
|
|
||||||
Router.map(function() {
|
Router.map(function() {
|
||||||
this.route("/", {
|
this.route("/", {
|
||||||
name: "home",
|
name: "home",
|
||||||
|
|||||||
11
rpg-docs/client/views/notFound/notFound.html
Normal file
11
rpg-docs/client/views/notFound/notFound.html
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<template name="notFound">
|
||||||
|
<div layout vertical center center-justified fit>
|
||||||
|
<h2>The data for the page you requested could not be found.</h2>
|
||||||
|
{{#if currentUser}}
|
||||||
|
<h2>It might not exist, or you might not have permission to view it.</h2>
|
||||||
|
{{else}}
|
||||||
|
<h2>Perhaps you need to sign in first:</h2>
|
||||||
|
{{atForm}}
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
47
rpg-docs/lib/constants/useraccountsConfig.js
Normal file
47
rpg-docs/lib/constants/useraccountsConfig.js
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
AccountsTemplates.configure({
|
||||||
|
//behaviour
|
||||||
|
sendVerificationEmail: true,
|
||||||
|
//appearance
|
||||||
|
continuousValidation: true,
|
||||||
|
negativeValidation: true,
|
||||||
|
negativeFeedback: true,
|
||||||
|
showValidating: true,
|
||||||
|
showAddRemoveServices: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
AccountsTemplates.configureRoute("enrollAccount");
|
||||||
|
AccountsTemplates.configureRoute("forgotPwd");
|
||||||
|
AccountsTemplates.configureRoute("resetPwd");
|
||||||
|
AccountsTemplates.configureRoute("signIn");
|
||||||
|
AccountsTemplates.configureRoute("signUp");
|
||||||
|
AccountsTemplates.configureRoute("verifyEmail");
|
||||||
|
AccountsTemplates.configureRoute("resendVerificationEmail");
|
||||||
|
|
||||||
|
if (Meteor.isServer){
|
||||||
|
Meteor.methods({
|
||||||
|
"userExists": function(username){
|
||||||
|
return !!Meteor.users.findOne({username: username});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
AccountsTemplates.addField({
|
||||||
|
_id: "username",
|
||||||
|
type: "text",
|
||||||
|
required: true,
|
||||||
|
func: function(value){
|
||||||
|
if (Meteor.isClient) {
|
||||||
|
var self = this;
|
||||||
|
Meteor.call("userExists", value, function(err, userExists){
|
||||||
|
if (!userExists)
|
||||||
|
self.setSuccess();
|
||||||
|
else
|
||||||
|
self.setError("This username is taken");
|
||||||
|
self.setValidating(false);
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Server
|
||||||
|
return Meteor.call("userExists", value);
|
||||||
|
},
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user