node.js - Criteria permission with sails-permissions -
i have created permission assigned criteria results in 404 not found, suggesting there no permitted records. can see output of log criteria { group: 1 } , there 1 record group = 1 1 record should returned yet can see permitted.lenth equal 0. familiar sails-permissions able advise on whether correct?
log output
silly: permissionpolicy: 1 permissions grant read on issue johnsmith info: responsepolicy silly: data [ { items: [ { owner: 1, group: 1, id: 1, title: 'an important issue', open: true, createdat: '2015-08-24t18:17:32.580z', updatedat: '2015-08-24t18:17:32.586z' }, { owner: 3, group: 2, id: 2, title: 'an issue belonging group', open: true, createdat: '2015-08-24t18:17:32.582z', updatedat: '2015-08-24t18:17:32.582z' } ], _pagination: { current: 1, limit: 30, items: 2, pages: 1 } } ] silly: options undefined silly: criteria! [ { where: { group: 1 }, permission: 45, createdat: '2015-08-24t18:10:36.891z', updatedat: '2015-08-24t18:10:36.891z', id: 1 } ] silly: permitted.length === 0
this caused custom find blueprint reformatting data structure, add pagination meta { items: [], _pagination: {...}}. conflicts sails-permissions expects find blueprint, array [].
Comments
Post a Comment