Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0] base_user_role: warning when adding admin to empty role #308

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from

Conversation

ajaniszewska-dev
Copy link

@ajaniszewska-dev ajaniszewska-dev commented Sep 5, 2024

When creating a new user role, it is possible to add a user to that role without having added any groups. If this is saved, all that user’s access rights will be wiped and he will not able to login anymore (Internal Server Error). It can cause problems when happens for admin user.

@OCA-git-bot
Copy link
Contributor

Hi @novawish, @sebalix, @jcdrubay,
some modules you are maintaining are being modified, check this out!

@ajaniszewska-dev ajaniszewska-dev force-pushed the base_user_role_admin_fix branch 4 times, most recently from d52fde8 to 2502d6c Compare September 6, 2024 07:54
@ajaniszewska-dev ajaniszewska-dev changed the title [14.0] base_user_role: prevent adding admin to empty role [14.0] base_user_role: warning when adding admin to empty role Sep 6, 2024
When creating a new user role, it is possible to add a user to that role without having added any groups.
If this is saved, all that user’s access rights will be wiped and he will not able to login anymore (Internal Server Error).
@ajaniszewska-dev ajaniszewska-dev marked this pull request as ready for review September 6, 2024 08:54
@@ -19,6 +19,19 @@ class ResUsers(models.Model):
compute_sudo=True,
)

@api.onchange("role_line_ids")
Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking of a computed boolean field to display or not a <div class="alert alert-warning" role="alert"> in the forms, less intrusive than a popup. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants