-
Notifications
You must be signed in to change notification settings - Fork 0
[T-7772][15.0][ADD] model_access_restriction #24
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
Conversation
Codecov ReportAttention: Patch coverage is
🚀 New features to boost your workflow:
|
29b695f
to
abb5695
Compare
@manuel-florido Can you review this pre-commit error? It seems to be a configuration issue |
Solved, please rebase 15.0 |
dd3c315
to
1213793
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.
Functional review LGTM
@manuelregidor This module is ready for the technical review |
733dd50
to
5b24a39
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.
Technical review. LGTM
@ValentinVinagre Can you review? |
This PR has the |
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.
Odoo indicates which groups you have to join if you don't have permission to perform an action. Has this been taken into account in this module?
f5672a1
to
147b705
Compare
@ValentinVinagre Can you review again? I have applied all your suggestions |
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.
I would like the missing permits to be implemented, let's give it a little more time and have them done.
@api.constrains("groups") | ||
def _check_groups(self): | ||
if self.filtered(lambda r: not r.groups): | ||
raise exceptions.ValidationError( |
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.
add to tests
"groups": [(4, cls.group.id)], | ||
} | ||
) | ||
|
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.
Add 2 tests to handle the 2 uncovered permissions "perm_write" and "perm_read".
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestModelAccessRestriction(TransactionCase): |
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.
I don't quite understand the tests. Can you provide a brief explanation?
A group and a restriction model are created... but:
What are the base permissions?
Which user is being tested?
This would require further explanation. New users would need to be created to control the permissions associated with them, not the ones created by the system, as these can vary depending on the Odoo version.
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.
The tested user is the root one, the base permissions are all
Which is being tested is if adding a new access restriction disables or not the permissions, assuming that the user has permissions without taking the restrictions into account
The default permissions won't change between versions because we are using the root user, the restrictions won't change because there is no one at installation
But anyway I'm going to review the tests to see what can be improved.
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.
@ValentinVinagre Reading and writing rights can be developed in a second iteration, as a new version of the module, as it is not part of the customer's requirements. |
I understand the point, I would like the module to be completed. |
Moved to oca: OCA/server-backend#352 |
No description provided.