-
-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #288 from CaptainN/v2
Remove underscore, add ecmascript package
- Loading branch information
Showing
15 changed files
with
241 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -211,7 +211,7 @@ var users = [ | |
{name:"Admin User",email:"[email protected]",roles:['admin']} | ||
]; | ||
|
||
_.each(users, function (user) { | ||
users.forEach(function (user) { | ||
var id; | ||
|
||
id = Accounts.createUser({ | ||
|
@@ -221,7 +221,7 @@ _.each(users, function (user) { | |
}); | ||
|
||
if (user.roles.length > 0) { | ||
_.each(user.roles, function (role) { | ||
user.roles.forEach(function (role) { | ||
Roles.createRole(role, {unlessExists: true}); | ||
}); | ||
// Need _id of existing user record so this call must come after `Accounts.createUser`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
Template.mainLayout.helpers({ | ||
notVerified: function () { | ||
notVerified: function () { | ||
var user = Meteor.user() | ||
|
||
return !emailVerified(user) | ||
} | ||
}) | ||
|
||
function emailVerified (user) { | ||
return _.some(user.emails, function (email) { | ||
return user.emails.some(function (email) { | ||
return email.verified | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,9 +26,9 @@ function createUsers () { | |
{name:"Admin User",email:"[email protected]",roles:['admin']} | ||
]; | ||
|
||
_.each(users, function (userData) { | ||
users.forEach(function (userData) { | ||
var id | ||
|
||
console.log(userData); | ||
|
||
id = Accounts.createUser({ | ||
|
@@ -41,12 +41,12 @@ function createUsers () { | |
Meteor.users.update({_id: id}, | ||
{$set:{'emails.0.verified': true}}); | ||
|
||
_.each(userData.roles, function (role) { | ||
userData.roles.forEach(function (role) { | ||
Roles.createRole(role, {unlessExists: true}); | ||
}); | ||
|
||
Roles.addUsersToRoles(id, userData.roles); | ||
|
||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
Template.mainLayout.helpers({ | ||
notVerified: function () { | ||
notVerified: function () { | ||
var user = Meteor.user() | ||
|
||
return !emailVerified(user) | ||
} | ||
}) | ||
|
||
function emailVerified (user) { | ||
return _.some(user.emails, function (email) { | ||
return user.emails.some(function (email) { | ||
return email.verified | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ Meteor.startup(function () { | |
//////////////////////////////////////////////////////////////////// | ||
// Create Test Secrets | ||
// | ||
|
||
if (Meteor.secrets.find().fetch().length === 0) { | ||
Meteor.secrets.insert({secret:"ec2 password: apple2"}); | ||
Meteor.secrets.insert({secret:"domain registration pw: apple3"}); | ||
|
@@ -34,10 +34,10 @@ Meteor.startup(function () { | |
{name:"Admin User",email:"[email protected]",roles:['admin']} | ||
]; | ||
|
||
_.each(users, function (userData) { | ||
users.forEach(function (userData) { | ||
var id, | ||
user; | ||
|
||
console.log(userData); | ||
|
||
id = Accounts.createUser({ | ||
|
@@ -49,12 +49,12 @@ Meteor.startup(function () { | |
// email verification | ||
Meteor.users.update({_id: id}, {$set:{'emails.0.verified': true}}); | ||
|
||
_.each(userData.roles, function (role) { | ||
userData.roles.forEach(function (role) { | ||
Roles.createRole(role, {unlessExists: true}); | ||
}); | ||
|
||
Roles.addUsersToRoles(id, userData.roles); | ||
|
||
}); | ||
} | ||
|
||
|
@@ -102,7 +102,7 @@ Meteor.publish("users", function () { | |
if (Roles.userIsInRole(user, ["admin","manage-users"])) { | ||
console.log('publishing users', this.userId); | ||
return Meteor.users.find({}, {fields: {emails: 1, profile: 1, roles: 1}}); | ||
} | ||
} | ||
|
||
this.stop(); | ||
return; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ Meteor.startup(function () { | |
//////////////////////////////////////////////////////////////////// | ||
// Create Test Secrets | ||
// | ||
|
||
if (Meteor.secrets.find().fetch().length === 0) { | ||
Meteor.secrets.insert({secret:"ec2 password: apple2"}); | ||
Meteor.secrets.insert({secret:"domain registration pw: apple3"}); | ||
|
@@ -34,10 +34,10 @@ Meteor.startup(function () { | |
{name:"Admin User",email:"[email protected]",roles:['admin']} | ||
]; | ||
|
||
_.each(users, function (userData) { | ||
users.forEach(function (userData) { | ||
var id, | ||
user; | ||
|
||
console.log(userData); | ||
|
||
id = Accounts.createUser({ | ||
|
@@ -49,12 +49,12 @@ Meteor.startup(function () { | |
// email verification | ||
Meteor.users.update({_id: id}, {$set:{'emails.0.verified': true}}); | ||
|
||
_.each(userData.roles, function (role) { | ||
userData.roles.forEach(function (role) { | ||
Roles.createRole(role, {unlessExists: true}); | ||
}); | ||
|
||
Roles.addUsersToRoles(id, userData.roles); | ||
|
||
}); | ||
} | ||
|
||
|
@@ -102,7 +102,7 @@ Meteor.publish("users", function () { | |
if (Roles.userIsInRole(user, ["admin","manage-users"])) { | ||
console.log('publishing users', this.userId); | ||
return Meteor.users.find({}, {fields: {emails: 1, profile: 1, roles: 1}}); | ||
} | ||
} | ||
|
||
this.stop(); | ||
return; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.