-
-
Notifications
You must be signed in to change notification settings - Fork 694
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
[FIX] product_cost_security: ORM-level security #1538
[FIX] product_cost_security: ORM-level security #1538
Conversation
Hi @sergio-teruel, |
95d1f34
to
b56309b
Compare
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.
Code LGTM
b56309b
to
0803eae
Compare
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.
@yajo ,
- As a Inventory "user" with our permisions in sales, purchase, etc., I get "Access Error" in common operations
You don't have permission to update product costs. Allowed group: Product costs / Modify product costs
Before this patch, inheriting modules had to manually add some logic related to guessing wether the user can access cost information. Also, smartypants users could still obtain the desired information through API calls. Now: - You can't read/write cost fields via API anymore. - Views automatically set those fields to readonly if the user has only read permissions (and the model inherits from the new mixin). - You don't need to enable debug mode anymore to follow configuration instructions. - Instructions improved. @moduon MT-5158
0803eae
to
d53def1
Compare
Oops... I forgot to drop the security on sudo mode. Fixed now, please review again. |
Both modules do essentially the same thing: apply a restriction over product costs. Thus, it makes sense to share the same permission groups. This refactor, that depends on OCA/product-attribute#1538, improves the module readme and makes `sale_margin_security` auto-installable addon when `product_cost_security` is found. A migration script is provided to make sure the same users still retain the same permissions. @moduon MT-5158
Following OCA/product-attribute#1538, the security is now done via mixin and the view can be removed. @moduon MT-5158
Now OCA/margin-analysis#198 depends on this PR to also unify the permissions interface with |
Both modules do essentially the same thing: apply a restriction over product costs. Thus, it makes sense to share the same permission groups. This refactor, that depends on OCA/product-attribute#1538, improves the module readme and makes `sale_margin_security` auto-installable addon when `product_cost_security` is found. A migration script is provided to make sure the same users still retain the same permissions. @moduon MT-5158
Following OCA/product-attribute#1538, the security is now done via mixin and the view can be removed. @moduon MT-5158
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.
Code review LGTM
/ocabot merge minor |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at ecd45b1. Thanks a lot for contributing to OCA. ❤️ |
Both modules do essentially the same thing: apply a restriction over product costs. Thus, it makes sense to share the same permission groups. This refactor, that depends on OCA/product-attribute#1538, improves the module readme and makes `sale_margin_security` auto-installable addon when `product_cost_security` is found. A migration script is provided to make sure the same users still retain the same permissions. @moduon MT-5158
Following OCA/product-attribute#1538, the security is now done via mixin and the view can be removed. @moduon MT-5158
Following OCA/product-attribute#1538, the security is now done via mixin and the view can be removed. @moduon MT-5158
Both modules do essentially the same thing: apply a restriction over product costs. Thus, it makes sense to share the same permission groups. This refactor, that depends on OCA/product-attribute#1538, improves the module readme and makes `sale_margin_security` auto-installable addon when `product_cost_security` is found. A migration script is provided to make sure the same users still retain the same permissions. @moduon MT-5158
Before this patch, inheriting modules had to manually add some logic related to guessing wether the user can access cost information. Also, smartypants users could still obtain the desired information through API calls.
Now:
@moduon MT-5158