These are chat archives for reactioncommerce/reaction
new session return all orders for sessionId (0) places an order as a guest - we now have 1 session order login as user - place order - we now have 2 session order returned (same session) logout as user - we now have 1 session order returned clear session - > we now have 0 orders login as user -> we now have 1 user order logout as user -> we now have 0 orders place order as guest -> we now have 1 guest (session) order
I can help out with a PR to if we discuss what logic should be followed, I also think
unless ReactionCore.hasPermission('createProduct') throw new Meteor.Error 403, "Access Denied"
should also check for a shopId, no?
check(value, ReactionCore.Collections.Products.simpleSchema().getDefinition(field, ['type']).type);
ReactionCore.hasPermission('createProduct’)should always be shop specific as the actual method has
if Roles.userIsInRole userId, permissions, @shopId
unless ReactionCore.hasPermission('createProduct') throw new Meteor.Error 403, "Access Denied" @unblock()
hasPermission, but you should have permissions if the role is in either a shop or global (return true)
# permission check hasPermission: (permissions) -> # shop specific check if Roles.userIsInRole Meteor.userId(), permissions, @getShopId() return true # global roles check if Roles.userIsInRole Meteor.userId(), permissions, Roles.GLOBAL_GROUP return true
getShopId: -> return @shopId
getSellerShopIdthat should work in the way your old method worked there - but not sure it will be needed if we fine tune the get/set shopId(s) a bit