From 15e127d29b2ba3728ce6b80b0ed3dfe7aeed6181 Mon Sep 17 00:00:00 2001 From: Olivier Nibart Date: Thu, 26 Sep 2024 11:21:46 +0200 Subject: [PATCH] [14.0][FIX][IMP] base_user_role_profile --- base_user_role_profile/README.rst | 37 ++++++++++++---- base_user_role_profile/__manifest__.py | 1 + base_user_role_profile/readme/CONFIGURE.rst | 13 +++++- .../readme/CONTRIBUTORS.rst | 1 + base_user_role_profile/readme/DESCRIPTION.rst | 17 +++++--- base_user_role_profile/readme/USAGE.rst | 3 +- .../static/description/index.html | 42 ++++++++++++++----- 7 files changed, 88 insertions(+), 26 deletions(-) diff --git a/base_user_role_profile/README.rst b/base_user_role_profile/README.rst index 184a57a1d..c4364913a 100644 --- a/base_user_role_profile/README.rst +++ b/base_user_role_profile/README.rst @@ -7,7 +7,7 @@ User profiles !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:7f308b13d03b7b0e6850750c99b22d6402ac11c6dffc22e98b902f25d888360b + !! source digest: sha256:f0a35c3f15b1acf7c8ebc040651638e87cb2ded68c502f1d0260f48498d10330 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png @@ -31,13 +31,21 @@ User profiles Extending the base_user_role module, this one adds the notion of profiles. Effectively profiles act as an additional filter to how the roles are used. This allows users to switch their permission groups dynamically. This can be useful for example to: - - finer grain control on menu and model permissions (with record rules this becomes very flexible) - - break down complicated menus into simpler ones - - easily restrict users accidentally editing or creating records in O2M fields and in general misusing the interface, instead of excessively explaining things to them + + * finer grain control on menu and model permissions (with record rules this becomes very flexible) + * break down complicated menus into simpler ones + * easily restrict users accidentally editing or creating records in O2M fields and in general misusing the interface, instead of excessively explaining things to them When you define a role, you have the possibility to link it to a profile. Roles are applied to users in the following way: - - Apply user's roles without profiles in any case - - Apply user's roles that are linked to the currently selected profile + + * Apply user's roles without profiles in any case + * Apply user's roles that are linked to the currently selected profile + +In addition you can: + + * Add a 'no profile' profile to the user's choice of profile, to allow him to select a specific profile which enables only the roles without a profile. + * Restrict the user to change it's profile, which can be usefull in a security emergency. + **Table of contents** @@ -47,12 +55,24 @@ When you define a role, you have the possibility to link it to a profile. Roles Configuration ============= -Go to Configuration / Users / Profiles and create a profile. Go to Configuration / Users / Roles and define some role lines with profiles. +To configure this module, you need to go to *Configuration / Users / Profiles*, +and create a new profile. + +Then go to *Configuration / Users / Roles* and set some roles with a profile. + +Then go to *Configuration / Users / Users* and add some roles if not already done. The allowed profiles will computes automatically. + +In addition you can: + + * Check the "Include Default Profile" box to have the default profile as an allowed profile. + * Change the current profile if needed. + * Check the "Restrict Profile Switching" to restrict the user to change it's profile, in that case you can still change it from the user's settings form. Usage ===== -Once you have set up at least one profile for a user, use the widget in the top bar to switch user profiles. Note that it is possible to use no profile; in this case, the user will only get the roles that always apply (i.e the ones with no profile_id). +Once you have set up at least one profile for a user, use the widget in the top bar to switch user profiles. +Note that it is possible to use no profile; in this case, the user will only get the roles that always apply (i.e the ones with no profile_id). Bug Tracker =========== @@ -75,6 +95,7 @@ Authors Contributors ~~~~~~~~~~~~ +* Olivier Nibart * Kevin Khao * Sébastien Beau diff --git a/base_user_role_profile/__manifest__.py b/base_user_role_profile/__manifest__.py index 95f961eef..48e4139e5 100644 --- a/base_user_role_profile/__manifest__.py +++ b/base_user_role_profile/__manifest__.py @@ -7,6 +7,7 @@ "author": "Akretion, Odoo Community Association (OCA)", "license": "AGPL-3", "website": "https://github.com/OCA/server-backend", + "maintainers": ["nayatec"], "depends": ["base_user_role", "web"], "post_init_hook": "post_init_hook", "data": [ diff --git a/base_user_role_profile/readme/CONFIGURE.rst b/base_user_role_profile/readme/CONFIGURE.rst index d45c6d318..ffda27978 100644 --- a/base_user_role_profile/readme/CONFIGURE.rst +++ b/base_user_role_profile/readme/CONFIGURE.rst @@ -1 +1,12 @@ -Go to Configuration / Users / Profiles and create a profile. Go to Configuration / Users / Roles and define some role lines with profiles. +To configure this module, you need to go to *Configuration / Users / Profiles*, +and create a new profile. + +Then go to *Configuration / Users / Roles* and set some roles with a profile. + +Then go to *Configuration / Users / Users* and add some roles if not already done. The allowed profiles will computes automatically. + +In addition you can: + + * Check the "Include Default Profile" box to have the default profile as an allowed profile. + * Change the current profile if needed. + * Check the "Restrict Profile Switching" to restrict the user to change it's profile, in that case you can still change it from the user's settings form. diff --git a/base_user_role_profile/readme/CONTRIBUTORS.rst b/base_user_role_profile/readme/CONTRIBUTORS.rst index 79f515ed4..48f725ac9 100644 --- a/base_user_role_profile/readme/CONTRIBUTORS.rst +++ b/base_user_role_profile/readme/CONTRIBUTORS.rst @@ -1,2 +1,3 @@ +* Olivier Nibart * Kevin Khao * Sébastien Beau diff --git a/base_user_role_profile/readme/DESCRIPTION.rst b/base_user_role_profile/readme/DESCRIPTION.rst index 5eab53627..821fc5df4 100644 --- a/base_user_role_profile/readme/DESCRIPTION.rst +++ b/base_user_role_profile/readme/DESCRIPTION.rst @@ -1,10 +1,17 @@ Extending the base_user_role module, this one adds the notion of profiles. Effectively profiles act as an additional filter to how the roles are used. This allows users to switch their permission groups dynamically. This can be useful for example to: - - finer grain control on menu and model permissions (with record rules this becomes very flexible) - - break down complicated menus into simpler ones - - easily restrict users accidentally editing or creating records in O2M fields and in general misusing the interface, instead of excessively explaining things to them + + * finer grain control on menu and model permissions (with record rules this becomes very flexible) + * break down complicated menus into simpler ones + * easily restrict users accidentally editing or creating records in O2M fields and in general misusing the interface, instead of excessively explaining things to them When you define a role, you have the possibility to link it to a profile. Roles are applied to users in the following way: - - Apply user's roles without profiles in any case - - Apply user's roles that are linked to the currently selected profile + + * Apply user's roles without profiles in any case + * Apply user's roles that are linked to the currently selected profile + +In addition you can: + + * Add a 'no profile' profile to the user's choice of profile, to allow him to select a specific profile which enables only the roles without a profile. + * Restrict the user to change it's profile, which can be usefull in a security emergency. diff --git a/base_user_role_profile/readme/USAGE.rst b/base_user_role_profile/readme/USAGE.rst index b76ca9eaa..d65a797bb 100644 --- a/base_user_role_profile/readme/USAGE.rst +++ b/base_user_role_profile/readme/USAGE.rst @@ -1 +1,2 @@ -Once you have set up at least one profile for a user, use the widget in the top bar to switch user profiles. Note that it is possible to use no profile; in this case, the user will only get the roles that always apply (i.e the ones with no profile_id). +Once you have set up at least one profile for a user, use the widget in the top bar to switch user profiles. +Note that it is possible to use no profile; in this case, the user will only get the roles that always apply (i.e the ones with no profile_id). diff --git a/base_user_role_profile/static/description/index.html b/base_user_role_profile/static/description/index.html index db66adc9f..e609d4763 100644 --- a/base_user_role_profile/static/description/index.html +++ b/base_user_role_profile/static/description/index.html @@ -366,25 +366,32 @@

User profiles

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:7f308b13d03b7b0e6850750c99b22d6402ac11c6dffc22e98b902f25d888360b +!! source digest: sha256:f0a35c3f15b1acf7c8ebc040651638e87cb2ded68c502f1d0260f48498d10330 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/server-backend Translate me on Weblate Try me on Runboat

Extending the base_user_role module, this one adds the notion of profiles. Effectively profiles act as an additional filter to how the roles are used.

-
-
This allows users to switch their permission groups dynamically. This can be useful for example to:
-
    +

    This allows users to switch their permission groups dynamically. This can be useful for example to:

    +
    +
    • finer grain control on menu and model permissions (with record rules this becomes very flexible)
    • break down complicated menus into simpler ones
    • easily restrict users accidentally editing or creating records in O2M fields and in general misusing the interface, instead of excessively explaining things to them
    -
-
When you define a role, you have the possibility to link it to a profile. Roles are applied to users in the following way:
-
    + +

    When you define a role, you have the possibility to link it to a profile. Roles are applied to users in the following way:

    +
    +
    • Apply user’s roles without profiles in any case
    • Apply user’s roles that are linked to the currently selected profile
    -
-
+ +

In addition you can:

+
+
    +
  • Add a ‘no profile’ profile to the user’s choice of profile, to allow him to select a specific profile which enables only the roles without a profile.
  • +
  • Restrict the user to change it’s profile, which can be usefull in a security emergency.
  • +
+

Table of contents

    @@ -401,11 +408,23 @@

    User profiles

Configuration

-

Go to Configuration / Users / Profiles and create a profile. Go to Configuration / Users / Roles and define some role lines with profiles.

+

To configure this module, you need to go to Configuration / Users / Profiles, +and create a new profile.

+

Then go to Configuration / Users / Roles and set some roles with a profile.

+

Then go to Configuration / Users / Users and add some roles if not already done. The allowed profiles will computes automatically.

+

In addition you can:

+
+
    +
  • Check the “Include Default Profile” box to have the default profile as an allowed profile.
  • +
  • Change the current profile if needed.
  • +
  • Check the “Restrict Profile Switching” to restrict the user to change it’s profile, in that case you can still change it from the user’s settings form.
  • +
+

Usage

-

Once you have set up at least one profile for a user, use the widget in the top bar to switch user profiles. Note that it is possible to use no profile; in this case, the user will only get the roles that always apply (i.e the ones with no profile_id).

+

Once you have set up at least one profile for a user, use the widget in the top bar to switch user profiles. +Note that it is possible to use no profile; in this case, the user will only get the roles that always apply (i.e the ones with no profile_id).

Bug Tracker

@@ -426,6 +445,7 @@

Authors