Thursday, August 20, 2015
1 change · master
New functionality added to Odoo
This change adds a shared way to determine whether a user is an administrator, covering both the superadmin and ERP manager cases. It reduces duplicated checks across several areas and helps prevent inconsistent access behavior in future changes.
Original PR description
Checks that the provided user (or user in the provided dataset): - is the superadmin - or is a member of group_erp_manager There are a number of hand-rolled "is_admin" checks in the codebase some of which are fairly gnarly. The shortcut provides a single point of contact, avoids forgetting about cases (e.g. SUPERUSER_ID) and is relatively convenient when checking a user which is not the "current" user. /cc @odony @tde-banana-odoo @rco-odoo