Skip to content

Conversation

@BhaveshHeliconia
Copy link
Contributor

No description provided.

@BhaveshHeliconia BhaveshHeliconia mentioned this pull request Apr 28, 2025
12 tasks
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-base_user_effective_permissions branch 2 times, most recently from e61b84b to d35c607 Compare April 29, 2025 07:11
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-base_user_effective_permissions branch from d35c607 to aedf873 Compare April 29, 2025 10:33
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-base_user_effective_permissions branch from aedf873 to ab6a1ae Compare July 25, 2025 06:57
@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Nov 23, 2025
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-base_user_effective_permissions branch from ab6a1ae to 11a0a46 Compare November 25, 2025 06:28
@BhaveshHeliconia
Copy link
Contributor Author

Hey @OCA/tools-maintainers would be great if someone could have a look at this module.

@legalsylvain
Copy link
Contributor

@hbrunn : could you take a look on this migration ?

Copy link
Member

@hbrunn hbrunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ocabot migration base_user_effective_permissions

f"{operation}_domain": IrRule._compute_domain(
for operation in operations:
try:
model.check_access(operation)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not the equivalent of v16's model.check_access_rights - use ir.model.access#check instead

vals[f"{operation}_permission"] = True
except Exception:
vals[f"{operation}_permission"] = False
try:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

under which conditions is this expected to raise? I'd expect something to be very wrong when this happens, and then we shouldn't squelch the exception

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you didn't answer this question

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _compute_domain() method can raise an AccessError when:

  1. The user doesn't have access to certain ir.rule records
  2. Domain evaluation fails due to missing fields or invalid domain syntax
  3. Security restrictions prevent domain computation for specific models

In these cases, setting an empty domain "[]" is appropriate as it indicates no domain-based restrictions beyond the basic access rights check already performed by ir.model.access#check.
However, you're right that we shouldn't squelch all exceptions. I'll update the code to catch only AccessError

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

obvious copy&paste from coding assistant, no interest to continue discussion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hbrunn here I accept that I used AI but its only to clean up the wording, since sometimes I struggle to words things well. Sorry if that caused any confusion.
Next onwards I will try to best to answer well.

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Nov 25, 2025
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-base_user_effective_permissions branch from 11a0a46 to 1f9939e Compare November 26, 2025 04:19
@BhaveshHeliconia
Copy link
Contributor Author

@hbrunn : I’ve made the changes as per your suggestion. Could you please review? Thanks!”

@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-base_user_effective_permissions branch from 1f9939e to 2e88e57 Compare November 26, 2025 10:49
@github-actions github-actions bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Nov 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants