From 1d2f26303754b8e13ed902ee1ebf2b6525ead679 Mon Sep 17 00:00:00 2001 From: Andrei Cioromila <andrei.cioromila@thinslices.com> Date: Wed, 10 Oct 2018 13:41:46 +0300 Subject: [PATCH] refactor(authsome): Remove validation for unused route --- packages/xpub-faraday/config/authsome-mode.js | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/packages/xpub-faraday/config/authsome-mode.js b/packages/xpub-faraday/config/authsome-mode.js index 89c0caf14..bf1c2ed47 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 }) } -- GitLab