mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
fixed an issue of filtering who can delete products, and added one set of permissions to view manage.
This commit is contained in:
parent
7641b17e6f
commit
0690e70ebe
3 changed files with 9 additions and 12 deletions
|
|
@ -57,13 +57,6 @@ Meteor.methods({
|
|||
throw new Meteor.Error('You are not allowed to delete products. Make sure you are logged in with valid user credentials.');
|
||||
}
|
||||
|
||||
let prodInfo = Products.findOne({ _id: prodId });
|
||||
let myId = this.userId;
|
||||
if (myId == prodInfo.prodOwner) {
|
||||
return Products.remove({ _id: prodId });
|
||||
} else {
|
||||
console.log("User not allowed to delete this product. Not the owner!");
|
||||
return("Not Allowed!");
|
||||
}
|
||||
return Products.remove({ _id: prodId });
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue