Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions imports/plugins/core/accounts/server/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ Meteor.startup(() => {
emailIsVerified = true;
}

if (user.emails[0]) {
user.emails[0].provides = "default";
}

// create a tokenObj and send a welcome email to new users,
// but skip the first default admin user and anonymous users
// (default admins already get a verification email)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,18 +389,7 @@ Meteor.publish("ProductsAdminList", function (page = 0, limit = 24, productFilte
return this.ready();
}

// Get a list of shopIds that this user has "createProduct" permissions for (owner permission is checked by default)
const userAdminShopIds = Reaction.getShopsWithRoles(["createProduct"], this.userId) || [];

// If the user isn't an admin of any shop, then don't show them any products
if (userAdminShopIds.length === 0) {
return this.ready();
}

// We publish an admin version of this publication to admins of products who are in "Edit Mode"
// Limit to only shops we have "createProduct" role for
selector.shopId.$in = _.intersection(selector.shopId.$in, userAdminShopIds);
if (selector.shopId.$in.length === 0) {
if (!Reaction.hasPermission(["createProduct"])) {
return this.ready();
}

Expand Down