New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extending app support #5767
Extending app support #5767
Conversation
…d mutations to keep the same convention
Codecov Report
@@ Coverage Diff @@
## master #5767 +/- ##
==========================================
+ Coverage 91.78% 91.88% +0.09%
==========================================
Files 373 378 +5
Lines 23729 24163 +434
Branches 2187 2220 +33
==========================================
+ Hits 21779 22201 +422
- Misses 1428 1437 +9
- Partials 522 525 +3
Continue to review full report at Codecov.
|
Here is the report for 95abf65 (mirumee/saleor @ feature/extending_app_support) **Found 13 differences!** (click me)
# saleor.graphql.accountbenchmark account
test name left count right count duplicate count
----------------------------------------------------------- ----------- ----------- ---------------
+ delete staff members 35 32 0
+ query staff user 21 20 4
+ staff create 24 22 4
+ staff update groups and permissions 36 33 5
# saleor.graphql.accountbenchmark permission group
test name left count right count duplicate count
----------------------------------------------------------- ----------- ----------- ---------------
+ permission group create 21 19 2
+ permission group delete 22 20 3
+ permission group query 8 7 0
+ permission group update 36 33 1
+ permission group update remove users with manage staff 31 27 3
# saleor.graphql.checkoutbenchmark checkout mutations
test name left count right count duplicate count
----------------------------------------------------------- ----------- ----------- ---------------
add billing address to checkout 50 50 26
add shipping to checkout 37 37 11
checkout email update 28 28 13
checkout payment charge 29 29 7
checkout shipping address update 39 39 11
checkout voucher code 57 57 31
complete checkout 81 81 22
create checkout 125 125 60
update checkout lines 92 92 40
# saleor.graphql.checkoutbenchmark homepage
test name left count right count duplicate count
----------------------------------------------------------- ----------- ----------- ---------------
user checkout details 50 50 27
# saleor.graphql.menubenchmark homepage
test name left count right count duplicate count
----------------------------------------------------------- ----------- ----------- ---------------
retrieve main menu 5 5 0
retrieve secondary menu 5 5 0
# saleor.graphql.orderbenchmark order
test name left count right count duplicate count
----------------------------------------------------------- ----------- ----------- ---------------
user order details 17 17 3
# saleor.graphql.productbenchmark category
test name left count right count duplicate count
----------------------------------------------------------- ----------- ----------- ---------------
category view 18 18 1
# saleor.graphql.productbenchmark collection
test name left count right count duplicate count
----------------------------------------------------------- ----------- ----------- ---------------
collection view 17 17 0
# saleor.graphql.productbenchmark homepage
test name left count right count duplicate count
----------------------------------------------------------- ----------- ----------- ---------------
featured products list 14 14 0
retrieve product list 5 5 0
# saleor.graphql.productbenchmark product
test name left count right count duplicate count
----------------------------------------------------------- ----------- ----------- ---------------
product details 16 16 0
retrieve product attributes 7 7 0
# saleor.graphql.productbenchmark variant
test name left count right count duplicate count
----------------------------------------------------------- ----------- ----------- ---------------
+ product variant bulk create 48 47 2
retrieve variant list 18 18 2
# saleor.graphql.productbenchmark variant stocks
test name left count right count duplicate count
----------------------------------------------------------- ----------- ----------- ---------------
+ product variants stocks create 23 22 5
+ product variants stocks delete 20 19 5
+ product variants stocks update 28 27 5
# saleor.graphql.producttest product sorting attributes
test name left count right count duplicate count
----------------------------------------------------------- ----------- ----------- ---------------
sort product not having attribute data 20 20 0
# saleor.graphql.shopbenchmark homepage
test name left count right count duplicate count
----------------------------------------------------------- ----------- ----------- ---------------
retrieve shop 2 2 0 |
… Drop django auth backend.
Feature/add jwt for apps
3abc7ae
to
b103eca
Compare
def ensure_can_manage_permissions(requestor, permission_items): | ||
"""Check if requestor can manage permissions from input. | ||
|
||
Requestor cannot manage permissions witch he doesn't have. It raises | ||
ValidationError when requestor doesn't have required permissions. | ||
""" | ||
if requestor_is_superuser(requestor): | ||
return | ||
missing_permissions = get_out_of_scope_permissions(requestor, permission_items) | ||
if missing_permissions: | ||
error_msg = "You can't add permission that you don't have." | ||
code = AppErrorCode.OUT_OF_SCOPE_PERMISSION.value | ||
params = {"permissions": missing_permissions} | ||
raise ValidationError( | ||
{"permissions": ValidationError(error_msg, code=code, params=params)} | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If think we should create generic utility function from that, but maybe in other PR, the scope of this one is big enough 😄
Docs explain everything - saleor/saleor-docs#131