Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix checking one-of permissions
Marcin Gębala2db602e94858
diff --git a/saleor/graphql/account/types.py b/saleor/graphql/account/types.pyindex a9f1fcea61..1819195364 100644--- a/saleor/graphql/account/types.py+++ b/saleor/graphql/account/types.py@@ -142,8 +142,10 @@ class CustomerEvent(CountableDjangoObjectType):@staticmethoddef resolve_user(root: models.CustomerEvent, info):user = info.context.user- if user == root.user or user.has_perms(- [AccountPermissions.MANAGE_USERS, AccountPermissions.MANAGE_STAFF]+ if (+ user == root.user+ or user.has_perm(AccountPermissions.MANAGE_USERS)+ or user.has_perm(AccountPermissions.MANAGE_STAFF)):return root.userraise PermissionDenied()diff --git a/saleor/graphql/order/types.py b/saleor/graphql/order/types.pyindex 95e9578fe1..9a9555f437 100644--- a/saleor/graphql/order/types.py+++ b/saleor/graphql/order/types.py@@ -68,8 +68,10 @@ class OrderEvent(CountableDjangoObjectType):@staticmethoddef resolve_user(root: models.OrderEvent, info):user = info.context.user- if user == root.user or user.has_perms(- [AccountPermissions.MANAGE_USERS, AccountPermissions.MANAGE_STAFF]+ if (+ user == root.user+ or user.has_perm(AccountPermissions.MANAGE_USERS)+ or user.has_perm(AccountPermissions.MANAGE_STAFF)):return root.userraise PermissionDenied()