diff --git a/packages/xpub-faraday/config/authsome-mode.js b/packages/xpub-faraday/config/authsome-mode.js index 89c0caf14801a234d20013a8d2e16ec10fdeceb6..bf1c2ed4786f543a3777af550122385b83bb21c7 100644 --- a/packages/xpub-faraday/config/authsome-mode.js +++ b/packages/xpub-faraday/config/authsome-mode.js @@ -60,32 +60,6 @@ const createPaths = ['/collections', '/collections/:collectionId/fragments'] async function applyAuthenticatedUserPolicy(user, operation, object, context) { if (operation === 'GET') { - if (get(object, 'path') === '/collections') { - return { - filter: async collections => { - const userPermissions = await helpers.getUserPermissions({ - user, - Team: context.models.Team, - }) - return collections.filter(collection => { - if (collection.owners.includes(user.id)) { - return true - } - const collectionPermission = userPermissions.find( - p => p.objectId === collection.id, - ) - if (collectionPermission) { - return true - } - - return userPermissions.find(p => - collection.fragments.includes(p.objectId), - ) - }) - }, - } - } - if (get(object, 'path') === '/api/users') { return helpers.getUsersList({ UserModel: context.models.User, user }) }