Blame view

imports/startup/server/fixtures.js 429 Bytes
2b1ad7917   tmcdeveloper   wip moving to Met...
1
2
3
4
  const users = [{
    email: 'admin@admin.com',
    password: 'password',
    profile: {
f0c912bf1   tmcdeveloper   add method tests ...
5
6
      name: { first: 'Carl', last: 'Winslow' },
    },
eb1d80ea8   tmcdeveloper   just kidding, now...
7
    roles: ['admin'],
2b1ad7917   tmcdeveloper   wip moving to Met...
8
  }];
16e6a1bd6   tmcdeveloper   add admin role to...
9
  users.forEach(({ email, password, profile, roles }) => {
f0c912bf1   tmcdeveloper   add method tests ...
10
    const userExists = Meteor.users.findOne({ 'emails.address': email });
2b1ad7917   tmcdeveloper   wip moving to Met...
11

f0c912bf1   tmcdeveloper   add method tests ...
12
    if (!userExists) {
16e6a1bd6   tmcdeveloper   add admin role to...
13
14
      const userId = Accounts.createUser({ email, password, profile });
      Roles.addUsersToRoles(userId, roles);
2b1ad7917   tmcdeveloper   wip moving to Met...
15
16
    }
  });