Skip to content

Commit b73306d

Browse files
[IMP] base_user_effective_permissions: pre-commit auto fixes
1 parent d7f90e3 commit b73306d

File tree

11 files changed

+53
-34
lines changed

11 files changed

+53
-34
lines changed

base_user_effective_permissions/README.rst

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,20 @@ Effective permissions
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--backend-lightgray.png?logo=github
20-
:target: https://github.com/OCA/server-backend/tree/16.0/base_user_effective_permissions
20+
:target: https://github.com/OCA/server-backend/tree/18.0/base_user_effective_permissions
2121
:alt: OCA/server-backend
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/server-backend-16-0/server-backend-16-0-base_user_effective_permissions
23+
:target: https://translation.odoo-community.org/projects/server-backend-18-0/server-backend-18-0-base_user_effective_permissions
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-backend&target_branch=16.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-backend&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
3030

31-
This module shows administrators a combined view of access rights and record rules per model with expressions expanded. This is convenient for reviewing permissions.
31+
This module shows administrators a combined view of access rights and
32+
record rules per model with expressions expanded. This is convenient for
33+
reviewing permissions.
3234

3335
.. IMPORTANT::
3436
This is an alpha version, the data model and design can change at any time without warning.
@@ -45,36 +47,38 @@ Usage
4547

4648
To use this module, you need to be in developer mode and:
4749

48-
#. Go to Settings/Users & Companies
49-
#. Open a user
50-
#. Click the `Effective permissions` button
51-
#. Note you can switch between the rule domains in text form or as domain widget
50+
1. Go to Settings/Users & Companies
51+
2. Open a user
52+
3. Click the Effective permissions button
53+
4. Note you can switch between the rule domains in text form or as
54+
domain widget
5255

5356
Bug Tracker
5457
===========
5558

5659
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-backend/issues>`_.
5760
In case of trouble, please check there if your issue has already been reported.
5861
If you spotted it first, help us to smash it by providing a detailed and welcomed
59-
`feedback <https://github.com/OCA/server-backend/issues/new?body=module:%20base_user_effective_permissions%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
62+
`feedback <https://github.com/OCA/server-backend/issues/new?body=module:%20base_user_effective_permissions%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
6063

6164
Do not contact contributors directly about support or help with technical issues.
6265

6366
Credits
6467
=======
6568

6669
Authors
67-
~~~~~~~
70+
-------
6871

6972
* Hunki Enterprises BV
7073

7174
Contributors
72-
~~~~~~~~~~~~
75+
------------
7376

74-
* Holger Brunn <[email protected]> (https://hunki-enterprises.com)
77+
- Holger Brunn <[email protected]>
78+
(https://hunki-enterprises.com)
7579

7680
Maintainers
77-
~~~~~~~~~~~
81+
-----------
7882

7983
This module is maintained by the OCA.
8084

@@ -94,6 +98,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
9498

9599
|maintainer-hbrunn|
96100

97-
This module is part of the `OCA/server-backend <https://github.com/OCA/server-backend/tree/16.0/base_user_effective_permissions>`_ project on GitHub.
101+
This module is part of the `OCA/server-backend <https://github.com/OCA/server-backend/tree/18.0/base_user_effective_permissions>`_ project on GitHub.
98102

99103
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

base_user_effective_permissions/models/res_users_effective_permission.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,17 @@ def _generate_permissions(self, user):
5151
vals = {"model_id": model_record.id}
5252
vals.update(
5353
{
54-
"%s_permission"
55-
% operation: model.check_access_rights(operation, False)
54+
f"{operation}_permission": model.check_access_rights(
55+
operation, False
56+
)
5657
for operation in operations
5758
}
5859
)
5960
vals.update(
6061
{
61-
"%s_domain"
62-
% operation: IrRule._compute_domain(model._name, operation)
62+
f"{operation}_domain": IrRule._compute_domain(
63+
model._name, operation
64+
)
6365
for operation in operations
6466
}
6567
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Holger Brunn \<[email protected]\>
2+
(<https://hunki-enterprises.com>)

base_user_effective_permissions/readme/CONTRIBUTORS.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This module shows administrators a combined view of access rights and
2+
record rules per model with expressions expanded. This is convenient for
3+
reviewing permissions.

base_user_effective_permissions/readme/DESCRIPTION.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
To use this module, you need to be in developer mode and:
2+
3+
1. Go to Settings/Users & Companies
4+
2. Open a user
5+
3. Click the Effective permissions button
6+
4. Note you can switch between the rule domains in text form or as
7+
domain widget

base_user_effective_permissions/readme/USAGE.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.

base_user_effective_permissions/static/description/index.html

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,10 @@ <h1 class="title">Effective permissions</h1>
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370370
!! source digest: sha256:5108ef47acdaa695d28924080b90d6d1c72304a18c7cd09f4314fa0ecdeab7b0
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.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/16.0/base_user_effective_permissions"><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-16-0/server-backend-16-0-base_user_effective_permissions"><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=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373-
<p>This module shows administrators a combined view of access rights and record rules per model with expressions expanded. This is convenient for reviewing permissions.</p>
372+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.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/18.0/base_user_effective_permissions"><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-18-0/server-backend-18-0-base_user_effective_permissions"><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=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373+
<p>This module shows administrators a combined view of access rights and
374+
record rules per model with expressions expanded. This is convenient for
375+
reviewing permissions.</p>
374376
<div class="admonition important">
375377
<p class="first admonition-title">Important</p>
376378
<p class="last">This is an alpha version, the data model and design can change at any time without warning.
@@ -396,16 +398,17 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
396398
<ol class="arabic simple">
397399
<li>Go to Settings/Users &amp; Companies</li>
398400
<li>Open a user</li>
399-
<li>Click the <cite>Effective permissions</cite> button</li>
400-
<li>Note you can switch between the rule domains in text form or as domain widget</li>
401+
<li>Click the Effective permissions button</li>
402+
<li>Note you can switch between the rule domains in text form or as
403+
domain widget</li>
401404
</ol>
402405
</div>
403406
<div class="section" id="bug-tracker">
404407
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
405408
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-backend/issues">GitHub Issues</a>.
406409
In case of trouble, please check there if your issue has already been reported.
407410
If you spotted it first, help us to smash it by providing a detailed and welcomed
408-
<a class="reference external" href="https://github.com/OCA/server-backend/issues/new?body=module:%20base_user_effective_permissions%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
411+
<a class="reference external" href="https://github.com/OCA/server-backend/issues/new?body=module:%20base_user_effective_permissions%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
409412
<p>Do not contact contributors directly about support or help with technical issues.</p>
410413
</div>
411414
<div class="section" id="credits">
@@ -419,7 +422,8 @@ <h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
419422
<div class="section" id="contributors">
420423
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
421424
<ul class="simple">
422-
<li>Holger Brunn &lt;<a class="reference external" href="mailto:mail&#64;hunki-enterprises.com">mail&#64;hunki-enterprises.com</a>&gt; (<a class="reference external" href="https://hunki-enterprises.com">https://hunki-enterprises.com</a>)</li>
425+
<li>Holger Brunn &lt;<a class="reference external" href="mailto:mail&#64;hunki-enterprises.com">mail&#64;hunki-enterprises.com</a>&gt;
426+
(<a class="reference external" href="https://hunki-enterprises.com">https://hunki-enterprises.com</a>)</li>
423427
</ul>
424428
</div>
425429
<div class="section" id="maintainers">
@@ -433,7 +437,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
433437
promote its widespread use.</p>
434438
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
435439
<p><a class="reference external image-reference" href="https://github.com/hbrunn"><img alt="hbrunn" src="https://github.com/hbrunn.png?size=40px" /></a></p>
436-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-backend/tree/16.0/base_user_effective_permissions">OCA/server-backend</a> project on GitHub.</p>
440+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-backend/tree/18.0/base_user_effective_permissions">OCA/server-backend</a> project on GitHub.</p>
437441
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
438442
</div>
439443
</div>

base_user_effective_permissions/views/res_users.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
type="object"
1313
groups="base.group_no_one"
1414
icon="fa-shield"
15-
><span class="o_stat_text">Effective permissions</span></button>
15+
>
16+
<span class="o_stat_text">Effective permissions</span>
17+
</button>
1618
</xpath>
1719
</field>
1820
</record>

0 commit comments

Comments
 (0)