Skip to content

Commit

Permalink
[14.0][FIX][IMP] base_user_role_profile
Browse files Browse the repository at this point in the history
  • Loading branch information
nayatec committed Sep 27, 2024
1 parent e2e96cc commit 15e127d
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 26 deletions.
37 changes: 29 additions & 8 deletions base_user_role_profile/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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**

Expand All @@ -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
===========
Expand All @@ -75,6 +95,7 @@ Authors
Contributors
~~~~~~~~~~~~

* Olivier Nibart <olivier.nibart@akretion.com>
* Kevin Khao <kevin.khao@akretion.com>
* Sébastien Beau <sebastien.beau@akretion.com>

Expand Down
1 change: 1 addition & 0 deletions base_user_role_profile/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
13 changes: 12 additions & 1 deletion base_user_role_profile/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions base_user_role_profile/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* Olivier Nibart <olivier.nibart@akretion.com>
* Kevin Khao <kevin.khao@akretion.com>
* Sébastien Beau <sebastien.beau@akretion.com>
17 changes: 12 additions & 5 deletions base_user_role_profile/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 2 additions & 1 deletion base_user_role_profile/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -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).
42 changes: 31 additions & 11 deletions base_user_role_profile/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -366,25 +366,32 @@ <h1 class="title">User profiles</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7f308b13d03b7b0e6850750c99b22d6402ac11c6dffc22e98b902f25d888360b
!! source digest: sha256:f0a35c3f15b1acf7c8ebc040651638e87cb2ded68c502f1d0260f48498d10330
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-backend/tree/14.0/base_user_role_profile"><img alt="OCA/server-backend" src="https://img.shields.io/badge/github-OCA%2Fserver--backend-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-backend-14-0/server-backend-14-0-base_user_role_profile"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-backend&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>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.</p>
<dl class="docutils">
<dt>This allows users to switch their permission groups dynamically. This can be useful for example to:</dt>
<dd><ul class="first last simple">
<p>This allows users to switch their permission groups dynamically. This can be useful for example to:</p>
<blockquote>
<ul class="simple">
<li>finer grain control on menu and model permissions (with record rules this becomes very flexible)</li>
<li>break down complicated menus into simpler ones</li>
<li>easily restrict users accidentally editing or creating records in O2M fields and in general misusing the interface, instead of excessively explaining things to them</li>
</ul>
</dd>
<dt>When you define a role, you have the possibility to link it to a profile. Roles are applied to users in the following way:</dt>
<dd><ul class="first last simple">
</blockquote>
<p>When you define a role, you have the possibility to link it to a profile. Roles are applied to users in the following way:</p>
<blockquote>
<ul class="simple">
<li>Apply user’s roles without profiles in any case</li>
<li>Apply user’s roles that are linked to the currently selected profile</li>
</ul>
</dd>
</dl>
</blockquote>
<p>In addition you can:</p>
<blockquote>
<ul class="simple">
<li>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.</li>
<li>Restrict the user to change it’s profile, which can be usefull in a security emergency.</li>
</ul>
</blockquote>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand All @@ -401,11 +408,23 @@ <h1 class="title">User profiles</h1>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<p>Go to Configuration / Users / Profiles and create a profile. Go to Configuration / Users / Roles and define some role lines with profiles.</p>
<p>To configure this module, you need to go to <em>Configuration / Users / Profiles</em>,
and create a new profile.</p>
<p>Then go to <em>Configuration / Users / Roles</em> and set some roles with a profile.</p>
<p>Then go to <em>Configuration / Users / Users</em> and add some roles if not already done. The allowed profiles will computes automatically.</p>
<p>In addition you can:</p>
<blockquote>
<ul class="simple">
<li>Check the “Include Default Profile” box to have the default profile as an allowed profile.</li>
<li>Change the current profile if needed.</li>
<li>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.</li>
</ul>
</blockquote>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
<p>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).</p>
<p>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).</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
Expand All @@ -426,6 +445,7 @@ <h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<ul class="simple">
<li>Olivier Nibart &lt;<a class="reference external" href="mailto:olivier.nibart&#64;akretion.com">olivier.nibart&#64;akretion.com</a>&gt;</li>
<li>Kevin Khao &lt;<a class="reference external" href="mailto:kevin.khao&#64;akretion.com">kevin.khao&#64;akretion.com</a>&gt;</li>
<li>Sébastien Beau &lt;<a class="reference external" href="mailto:sebastien.beau&#64;akretion.com">sebastien.beau&#64;akretion.com</a>&gt;</li>
</ul>
Expand Down

0 comments on commit 15e127d

Please sign in to comment.