Row-level access rules
We know that, by default, records with the active flag set to False are not visible, but a user can access them if needed, using a filter. Suppose that we don't want the regular library users to be able to access inactive books at all. This can be done using record rules — defining filters limiting what particular records a security group can access.
We can find the Record Rules option in the Technical menu, alongside Access Rights.
Record rules are defined in the ir.rule model. As usual, we need to provide a distinctive name. We also need the model they operate on and the domain filter to use for the access restriction. The domain filter uses the usual list of tuples syntax used across Odoo. We will be explaining this ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access