Skip to content

Commit

Permalink
IMPL changes backend ui users to a user type
Browse files Browse the repository at this point in the history
  • Loading branch information
FranzPoize committed Sep 8, 2023
1 parent b545069 commit 65b6eab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 1 addition & 8 deletions base_group_backend/data/res-groups.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,12 @@
</field>
</record>

<record model="ir.module.category" id="module_category_backend_user_type">
<field name="name">Backend user types</field>
<field name="description">Backend user types</field>
<field name="sequence">1</field>
</record>

<record model="res.groups" id="group_backend_ui_users">
<field name="name">Backend UI user</field>
<field name="category_id" ref="module_category_backend_user_type" />
<field name="category_id" ref="base.module_category_user_type" />
<field name="comment">
This group is used to gives user basic ui access.
</field>
<field name="implied_ids" eval="[(6, 0, [ref('base_group_backend')])]"/>
<field name="rule_groups" eval="[
(6, 0,[
ref('base.ir_default_user_rule'),
Expand Down
4 changes: 3 additions & 1 deletion base_group_backend/models/res_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ def has_group(self, group_ext_id):
if not res and (group_ext_id == "base.group_user"):
has_base_group_backend = super().has_group(
"base_group_backend.base_group_backend"
) or super().has_group(
"base_group_backend.base_group_backend_ui_users"
)
if has_base_group_backend:
_logger.warning("Forcing has_group to return True for group_backend")
_logger.warning("Forcing has_group to return True for group_backend and base_group_backend_ui_users")
return has_base_group_backend
return res

Expand Down

0 comments on commit 65b6eab

Please sign in to comment.