trailsjs / sails-permissions

Comprehensive user permissions and entitlements system for sails.js and Waterline. Supports user authentication with passport.js, role-based permissioning, object ownership, and row-level security.
MIT License
418 stars 113 forks source link

populate()- populating tables permission issue #248

Open saravanannnallasamy opened 7 years ago

saravanannnallasamy commented 7 years ago
Review.find().populate('packages').exec(function(err,record){
    if (err) throw err;
    sails.log.debug('record data : ' +util.inspect(record, {showHidden: true,depth: null}));
    return res.ok(record);
});

For Review table i have read permission, but for package table [ populate('packages') ] I don't have read permission but I getting all datas.

[
  {
    "packages": {
      "year": 2017,
      "type": 2,
      "id": 1,
      "createdAt": "2017-07-10T07:12:05.000Z",
      "updatedAt": "2017-07-10T07:12:05.000Z",
      "createdBy": 4,
      "owner": 4
    },
    "createdBy": 4,
    "owner": 4,
    "title": "Suzuki Gixxer",
    "text": "manual transmission",
    "category": "bikes",
    "id": 3,
    "createdAt": "2017-07-10T07:12:05.000Z",
    "updatedAt": "2017-07-10T07:12:05.000Z"
    }
]