|
|
|
@ -393,9 +393,15 @@ module.exports = {
|
|
|
|
|
* Get all entries from base path
|
|
|
|
|
*
|
|
|
|
|
* @param {String} basePath Path to list from
|
|
|
|
|
* @param {Object} usr Current user
|
|
|
|
|
* @return {Promise<Array>} List of entries
|
|
|
|
|
*/
|
|
|
|
|
getFromTree (basePath) {
|
|
|
|
|
return db.Entry.find({ parentPath: basePath }, 'title parentPath isDirectory isEntry').sort({ title: 'asc' })
|
|
|
|
|
getFromTree (basePath, usr) {
|
|
|
|
|
return db.Entry.find({ parentPath: basePath }, 'title parentPath isDirectory isEntry').sort({ title: 'asc' }).then(results => {
|
|
|
|
|
return _.filter(results, r => {
|
|
|
|
|
console.log(r._id, rights.checkRole(r._id, usr.rights, 'read'))
|
|
|
|
|
return rights.checkRole('/' + r._id, usr.rights, 'read')
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|