diff --git a/front/package-lock.json b/front/package-lock.json index 8b47b95a..f558b325 100644 --- a/front/package-lock.json +++ b/front/package-lock.json @@ -8,7 +8,6 @@ "name": "learnhouse", "version": "0.1.0", "dependencies": { - "crypto": "^1.0.1", "framer-motion": "^7.3.6", "next": "12.3.1", "react": "18.2.0", @@ -1309,12 +1308,6 @@ "node": ">= 8" } }, - "node_modules/crypto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz", - "integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==", - "deprecated": "This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in." - }, "node_modules/css-box-model": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/css-box-model/-/css-box-model-1.2.1.tgz", @@ -4819,11 +4812,6 @@ "which": "^2.0.1" } }, - "crypto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz", - "integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==" - }, "css-box-model": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/css-box-model/-/css-box-model-1.2.1.tgz", diff --git a/src/services/security.py b/src/services/security.py index 9bed2a6a..4a4b0e65 100644 --- a/src/services/security.py +++ b/src/services/security.py @@ -38,9 +38,10 @@ async def verify_user_rights_with_roles(action: str, user_id: str, element_id: s await check_database() roles = learnhouseDB["roles"] - user_roles_cursor = roles.find({ - "linked_users": str(user_id) - }) + # find data where user_id is in linked_users or * is in linked_users + user_roles_cursor = roles.find({"$or": [{"linked_users": user_id}, {"linked_users": "*"}]}) + + user_roles = []