Skip to content

Commit

Permalink
fixup! [ADD] base_user_effective_permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
hbrunn authored and OCA-git-bot committed Jun 7, 2024
1 parent d7f5c1f commit 7b1891f
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,22 @@ class ResUsersEffectivePermission(models.TransientModel):
def _generate_permissions(self, user):
permissions = self.browse([])
operations = ("create", "unlink", "read", "write")
IrRule = self.env["ir.rule"].with_user(user)
IrRule = (
self.env["ir.rule"]
.with_user(user)
.with_company(user.company_id)
.with_context(
allowed_company_ids=user.company_id.ids,
)
)
for model_record in self.env["ir.model"].search([]):
if model_record.model not in self.env:
continue

Check warning on line 44 in base_user_effective_permissions/models/res_users_effective_permission.py

View check run for this annotation

Codecov / codecov/patch

base_user_effective_permissions/models/res_users_effective_permission.py#L44

Added line #L44 was not covered by tests
model = (
self.env[model_record.model]
.with_user(user)
.with_company(user.company_id)
.with_context(allowed_company_ids=user.company_id.ids)
)
vals = {"model_id": model_record.id}
vals.update(
Expand Down

0 comments on commit 7b1891f

Please sign in to comment.