Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions document_page_access_group/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
==========================
Document Page Access Group
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c21399e1330aae842cb6046755b0816a2ef30f70268aa70cdf38441c5fded1b2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github
:target: https://github.com/OCA/knowledge/tree/15.0/document_page_access_group
:alt: OCA/knowledge
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/knowledge-15-0/knowledge-15-0-document_page_access_group
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/knowledge&target_branch=15.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to select which users groups have access to the
document pages.

**Table of contents**

.. contents::
:local:

Usage
=====

To select the users that have access to a given document page
you need to open a document, go to the 'Security' tab
and select which groups will have access.

Only users that belong to the 'Knowledge / Manager' group can
manage access groups to documents.

If no groups are selected in a document, all users that can access
document pages can access this document.

Bug Tracker
===========

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

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

Credits
=======

Authors
~~~~~~~

* Sygel

Contributors
~~~~~~~~~~~~

* Manuel Regidor <manuel.regidor@sygel.es>
* Alberto Martínez <alberto.martinez@sygel.es>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/knowledge <https://github.com/OCA/knowledge/tree/15.0/document_page_access_group>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions document_page_access_group/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2022 Manuel Regidor <manuel.regidor@sygel.es>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
19 changes: 19 additions & 0 deletions document_page_access_group/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2022 Manuel Regidor <manuel.regidor@sygel.es>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Document Page Access Group",
"summary": "Choose groups to access document pages",
"version": "15.0.1.0.0",
"category": "Knowledge",
"website": "https://github.com/OCA/knowledge",
"author": "Sygel, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"document_page",
"knowledge",
],
"data": ["views/document_page.xml", "security/security.xml"],
}
44 changes: 44 additions & 0 deletions document_page_access_group/i18n/document_page_access_group.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * document_page_access_group
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: document_page_access_group
#: model:ir.model.fields,field_description:document_page_access_group.field_document_page__display_name
msgid "Display Name"
msgstr ""

#. module: document_page_access_group
#: model:ir.model,name:document_page_access_group.model_document_page
msgid "Document Page"
msgstr ""

#. module: document_page_access_group
#: model:ir.model.fields,field_description:document_page_access_group.field_document_page__groups_id
msgid "Groups"
msgstr ""

#. module: document_page_access_group
#: model:ir.model.fields,field_description:document_page_access_group.field_document_page__id
msgid "ID"
msgstr ""

#. module: document_page_access_group
#: model:ir.model.fields,field_description:document_page_access_group.field_document_page____last_update
msgid "Last Modified on"
msgstr ""

#. module: document_page_access_group
#: model_terms:ir.ui.view,arch_db:document_page_access_group.document_page_access_group_view_wiki_form
msgid "Security"
msgstr ""
47 changes: 47 additions & 0 deletions document_page_access_group/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * document_page_access_group
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-06-05 13:08+0000\n"
"Last-Translator: luis-ron <luis.ron@sygel.es>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: document_page_access_group
#: model:ir.model.fields,field_description:document_page_access_group.field_document_page__display_name
msgid "Display Name"
msgstr "Nombre mostrado"

#. module: document_page_access_group
#: model:ir.model,name:document_page_access_group.model_document_page
msgid "Document Page"
msgstr "Página de documento"

#. module: document_page_access_group
#: model:ir.model.fields,field_description:document_page_access_group.field_document_page__groups_id
msgid "Groups"
msgstr "Grupos"

#. module: document_page_access_group
#: model:ir.model.fields,field_description:document_page_access_group.field_document_page__id
msgid "ID"
msgstr "ID"

#. module: document_page_access_group
#: model:ir.model.fields,field_description:document_page_access_group.field_document_page____last_update
msgid "Last Modified on"
msgstr "Última modificación el"

#. module: document_page_access_group
#: model_terms:ir.ui.view,arch_db:document_page_access_group.document_page_access_group_view_wiki_form
msgid "Security"
msgstr "Seguridad"
47 changes: 47 additions & 0 deletions document_page_access_group/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * document_page_access_group
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2022-12-29 02:09+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.14.1\n"

#. module: document_page_access_group
#: model:ir.model.fields,field_description:document_page_access_group.field_document_page__display_name
msgid "Display Name"
msgstr "Nome visualizzato"

#. module: document_page_access_group
#: model:ir.model,name:document_page_access_group.model_document_page
msgid "Document Page"
msgstr "Pagina documento"

#. module: document_page_access_group
#: model:ir.model.fields,field_description:document_page_access_group.field_document_page__groups_id
msgid "Groups"
msgstr "Gruppi"

#. module: document_page_access_group
#: model:ir.model.fields,field_description:document_page_access_group.field_document_page__id
msgid "ID"
msgstr "ID"

#. module: document_page_access_group
#: model:ir.model.fields,field_description:document_page_access_group.field_document_page____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"

#. module: document_page_access_group
#: model_terms:ir.ui.view,arch_db:document_page_access_group.document_page_access_group_view_wiki_form
msgid "Security"
msgstr "Sicurezza"
4 changes: 4 additions & 0 deletions document_page_access_group/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2022 Manuel Regidor <manuel.regidor@sygel.es>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import document_page
10 changes: 10 additions & 0 deletions document_page_access_group/models/document_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2022 Manuel Regidor <manuel.regidor@sygel.es>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class DocumentPage(models.Model):
_inherit = "document.page"

groups_id = fields.Many2many(comodel_name="res.groups", string="Groups")
2 changes: 2 additions & 0 deletions document_page_access_group/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Manuel Regidor <manuel.regidor@sygel.es>
* Alberto Martínez <alberto.martinez@sygel.es>
2 changes: 2 additions & 0 deletions document_page_access_group/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module allows to select which users groups have access to the
document pages.
9 changes: 9 additions & 0 deletions document_page_access_group/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
To select the users that have access to a given document page
you need to open a document, go to the 'Security' tab
and select which groups will have access.

Only users that belong to the 'Knowledge / Manager' group can
manage access groups to documents.

If no groups are selected in a document, all users that can access
document pages can access this document.
24 changes: 24 additions & 0 deletions document_page_access_group/security/security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2022 Manuel Regidor <manuel.regidor@sygel.es>
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo noupdate="1">
<record id="document_page_rule" model="ir.rule">
<field name="name">Document Page Access</field>
<field name="model_id" ref="model_document_page" />
<field eval="False" name="global" />
<field name="groups" eval="[(4, ref('knowledge.group_document_user'))]" />
<field
name="domain_force"
>['|', ('groups_id', '=', False), ('groups_id', 'in', [g.id for g in user.groups_id])]</field>
</record>
<record id="document_page_rule_full_access" model="ir.rule">
<field name="name">Document Page Full Access</field>
<field name="model_id" ref="model_document_page" />
<field eval="False" name="global" />
<field
name="groups"
eval="[(4, ref('document_page.group_document_manager'))]"
/>
<field name="domain_force">[(1, '=', 1)]</field>
</record>
</odoo>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading