You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've set up a permission for the registered role on a model with the relation set to owner,and the models have the owner attribute set but when a registered user requests some models they own the response is empty when pass through res.ok() even though models are found.
find: function(req, res) {
var page = req.param('page') || 1;
var limit = req.param('limit') || 10000000;
var defaultStatus = ['Pending', 'Can Cut Out', 'Already Cut Out', 'In Production', 'Design Sent', 'Production Picture Sent', 'Can Finish', 'Finished', 'Final Check', 'Shipped', 'Refunded'];
var status = req.param('status') || defaultStatus;
var owner = req.param('owner');
var query = {
status: status
};
if (owner) query.owner = owner;
Order.count(query).then(function(count) {
this.count = count;
return Order.find(query).paginate({
page: page,
limit: limit
}).populate('items').populate('owner').sort('createdAt DESC');
}).then(function(orders) {
console.log(orders);
res.set('Access-Control-Expose-Headers', 'X-Total-Count');
res.set('X-Total-Count', this.count);
res.ok(orders);
});
}
This is using v1.4.5
The text was updated successfully, but these errors were encountered:
dottodot
changed the title
Owner can't get own
Populate Owner breaks owner Permission
Jan 22, 2016
I've set up a permission for the registered role on a model with the relation set to owner,and the models have the owner attribute set but when a registered user requests some models they own the response is empty when pass through
res.ok()
even though models are found.This is using v1.4.5
The text was updated successfully, but these errors were encountered: