Skip to content

[MIG] auth_dynamic_groups to v10#96

Merged
hbrunn merged 25 commits into
OCA:10.0from
hbrunn:10.0-auth_dynamic_groups
Jun 27, 2019
Merged

[MIG] auth_dynamic_groups to v10#96
hbrunn merged 25 commits into
OCA:10.0from
hbrunn:10.0-auth_dynamic_groups

Conversation

@hbrunn

@hbrunn hbrunn commented May 13, 2019

Copy link
Copy Markdown
Member

This module allows defining groups whose membership is a condition expressed as
python code. For every user, it is evaluated during login if she belongs to
the group or not.

Configuration

Check Dynamic on a group you want to be dynamic. Now fill in the condition,
using user which is a browse record of the user in question that evaluates
truthy if the user is supposed to be a member of the group and falsy if not.

There is a constraint on the field to check for validity if this expression.
When you're satisfied, click the button Evaluate to prefill the group's
members. The condition will be checked now for every user who logs in.

Usage

We have a group called Amsterdam and want it to contain all users from
city of Amsterdam. So we use the membership condition

   user.partner_id.city == 'Amsterdam'

Now we can be sure every user living in this city is in the right group, and we
can start assigning local menus to it, adjust permissions, etc. Keep in mind
that view overrides can also be restricted by a group id, this gives a lot of
possibilities to dynamically adapt views based on arbitrary properties

@hbrunn

hbrunn commented May 13, 2019

Copy link
Copy Markdown
Member Author

PS: It's enough to review cfc3981, everything else already is in v8

@NL66278 NL66278 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍 Minor comments, not blocking. Just curious for the motivation to move this from the server-tools repo to server-auth.

Also might still be helpfull to squash adjacent Transifex commits.

@@ -0,0 +1,27 @@
<odoo>
<record model="ir.ui.view" id="view_groups_form">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

optional change:
id before model

"license": "AGPL-3",
"complexity": "normal",
'summary': 'Have membership conditions for certain groups',
"category": "Tools",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please add the website attribute with the value https://github.com/OCA/server-auth/

Comment thread auth_dynamic_groups/__manifest__.py Outdated
"auto_install": False,
"installable": True,
"external_dependencies": {
'python': [],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if you dont use the attribute, just delete it

@tbaden

tbaden commented May 15, 2019

Copy link
Copy Markdown
Member

thanks for the work 👍
just some minor details

@hbrunn
hbrunn force-pushed the 10.0-auth_dynamic_groups branch from cfc3981 to 4a66463 Compare May 20, 2019 07:57
@hbrunn

hbrunn commented May 20, 2019

Copy link
Copy Markdown
Member Author

@NL66278 @tbaden thanks, done

@tbaden tbaden left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks 👍

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@hbrunn
hbrunn merged commit 350e3ca into OCA:10.0 Jun 27, 2019
SiesslPhillip pushed a commit to grueneerde/OCA-server-auth that referenced this pull request Nov 20, 2024
Syncing from upstream OCA/server-auth (8.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants