Skip to content

Commit

Permalink
📖 update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mentalko authored and ilya ilchenko committed May 6, 2021
1 parent 59fdebd commit 65e2eae
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 20 deletions.
23 changes: 18 additions & 5 deletions access_restricted/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,31 @@
:alt: Tested and maintained by IT Projects Labs
:target: https://itpp.dev


Restricted administration rights
================================

The module makes impossible for administrator to set (and see) more access rights (groups) than he already has.
The only partial exception of this rule is made if you are already a member of the 'Allow add implied groups from settings' security group.
Then you are allowed to escalate your privileges but just from ``Settings`` menus (by means of ``group_XXX`` boolean fields of ``res.config.settings`` models views).
The module makes impossible for **Internal User** to set (or see) more access **groups/rights** than he already has.

Using this module, you can restrict access to changing some settings of other modules.
For take effect it should be used with modules such as CRM, Sales etc.
These modules have some parameters that add access groups to the user,
thereby making it possible to make important changes to the functionality.
With this module, only superuser-defined users can modify these fields.

This doesn't affect superuser, of course.

Typical usage of the module.
----------------------------

The superuser creates an administrator user without access group "Show Apps Menu" (see **access_apps** module). Then the administrator has access to settings, but not able to install new apps (without this module he can add himself to "Show Apps Menu" and get access to apps).
This example in addition to this module installed also requires our **access_apps** module.

- The superuser creates an admin user without any ``Apps Access`` option in its settings.Then the administrator has access to settings, but not able to install new apps.


- Without this module, it can change the option to ``Apps access: Allow installing apps`` and get access to apps management.


------------


Tested on `Odoo 14.0 <https://github.com/odoo/odoo/commit/c16d4b5e7b9181c2c792f595a117de10510d45be>`_
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 42 additions & 15 deletions access_restricted/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,57 @@
Installation
============

* `Install <https://odoo-development.readthedocs.io/en/latest/odoo/usage/install-module.html>`__ this module in a usual way
* `Install <https://odoo-development.readthedocs.io/en/latest/odoo/usage/install-module.html>`__ this module in a usual way.

Configuration
=============

* By default all users except a superuser restricted to escalate the privileges
* There is only one configuration option this module provides. Under superuser open menu ``[[ Settings ]] >> Users & Companies >> Users``
* In ``Access Rights`` tab you can select 'Allow add implied groups from settings' -
to allow some users to configure modules by means of ``group_XXX`` fields from ``Settings`` menus
**IMPORTANT NOTE:** By default, all users except the superuser are restricted from changing their access gropus for escalate privileges.

It allows certain users to configure modules from ``[[ Settings ]]``
menu using boolean fields which ``Field`` value starts with a **group_**
`(This info is displayed when hovering over the option name if developer tools is enabled)`

The only users who are in special group **'Allow add implied groups from settings'**
have access to make changes in forbidden for others fields.

There is only one configuration option this module provides:

- Under superuser open ``[[ Settings ]] >> Users & Companies >> Users`` and select user's profile
- In ``Access Rights`` tab activate 'Allow add implied groups from settings'

The user is then allowed to add additional access groups for himself
by using the Boolean settings fields. `(res.config.settings models views)`

Usage
=====
Let's take an example of using this module and **Sales** module (sale_management).

**Without this module installed:**

Say you have a user with administration rights ``Administration: Access Rights``.
This user thus may increase his own rights in ``Access Rights > Sales``
from ``Sales: User: Own Documents Only`` to ``Sales: Administrator``.

Also he can open menu ``[[ Sales ]] >> Configuration >> Settings`` and
select Customer Addresses (**group_** sale_delivery_address) there and then click ``[Apply]`` button


**With this module installed:**

The example user cannot increase their privileges.
There is no ``Sales: Administrator`` option for it and for this reason
there are no module settings, including the
``Client Addresses`` option.

============

Let's take ``Sales (sale_management)`` module as an example.
To activate the ``Customer Addresses`` option, the user must be:

Without this module installed:
- with administration rights ``Administration: Settings`` and also with ``Sales: Administrator`` rights

* Say you have a user with administration rights ``Administration: Access Rights``. This user thus may increase his own rights in ``Application Accesses`` from ``Sales: User: Own Documents Only``
to ``Sales: Administrator``. Also he can open menu ``[[ Sales ]] >> Configuration >> Settings`` and select ``Customer Addresses`` there
and then click ``[Apply]`` button (adding ``group_sale_delivery_address``)
- is included in the **'Allow add implied groups from settings'** group.

With this module installed:
The screenshot shows a user who is not included in the 'Allow add implied groups from settings' group and cannot activate the ``Customer Addresses`` option.

* The user from previous example cannot increase his privileges. There is no ``Sales: Manager`` option for him, and also no ``Customer Addresses``
option in module configuration
* The only exception is done for users who are in special group 'Allow add implied groups from settings' - if your user is included in this group by the superuser then you may select
``Customer Addresses`` from ``Sale`` module ``Configuration >> Settings`` menu
.. image:: access_restricted_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 65e2eae

Please sign in to comment.