diff --git a/document_page_access_group/README.rst b/document_page_access_group/README.rst new file mode 100644 index 00000000..16f0e862 --- /dev/null +++ b/document_page_access_group/README.rst @@ -0,0 +1,87 @@ +========================== +Document Page Access Group +========================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/14.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-14-0/knowledge-14-0-document_page_access_group + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/118/14.0 + :alt: Try me on Runbot + +|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 `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Sygel + +Contributors +~~~~~~~~~~~~ + +* Manuel Regidor + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/document_page_access_group/__init__.py b/document_page_access_group/__init__.py new file mode 100644 index 00000000..18143cb9 --- /dev/null +++ b/document_page_access_group/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2022 Manuel Regidor +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import models diff --git a/document_page_access_group/__manifest__.py b/document_page_access_group/__manifest__.py new file mode 100644 index 00000000..fe6e28d0 --- /dev/null +++ b/document_page_access_group/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2022 Manuel Regidor +# 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": "14.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"], +} diff --git a/document_page_access_group/i18n/document_page_access_group.pot b/document_page_access_group/i18n/document_page_access_group.pot new file mode 100644 index 00000000..13249f5a --- /dev/null +++ b/document_page_access_group/i18n/document_page_access_group.pot @@ -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 "" diff --git a/document_page_access_group/models/__init__.py b/document_page_access_group/models/__init__.py new file mode 100644 index 00000000..5aedcf2a --- /dev/null +++ b/document_page_access_group/models/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2022 Manuel Regidor +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import document_page diff --git a/document_page_access_group/models/document_page.py b/document_page_access_group/models/document_page.py new file mode 100644 index 00000000..e8ff91e9 --- /dev/null +++ b/document_page_access_group/models/document_page.py @@ -0,0 +1,10 @@ +# Copyright 2022 Manuel Regidor +# 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") diff --git a/document_page_access_group/readme/CONTRIBUTORS.rst b/document_page_access_group/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..9a191ccc --- /dev/null +++ b/document_page_access_group/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Manuel Regidor diff --git a/document_page_access_group/readme/DESCRIPTION.rst b/document_page_access_group/readme/DESCRIPTION.rst new file mode 100644 index 00000000..ecf456b6 --- /dev/null +++ b/document_page_access_group/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module allows to select which users groups have access to the +document pages. diff --git a/document_page_access_group/readme/USAGE.rst b/document_page_access_group/readme/USAGE.rst new file mode 100644 index 00000000..082de78c --- /dev/null +++ b/document_page_access_group/readme/USAGE.rst @@ -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. diff --git a/document_page_access_group/security/security.xml b/document_page_access_group/security/security.xml new file mode 100644 index 00000000..74366d60 --- /dev/null +++ b/document_page_access_group/security/security.xml @@ -0,0 +1,24 @@ + + + + + Document Page Access + + + + ['|', ('groups_id', '=', False), ('groups_id', 'in', [g.id for g in user.groups_id])] + + + Document Page Full Access + + + + [(1, '=', 1)] + + diff --git a/document_page_access_group/static/description/icon.png b/document_page_access_group/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/document_page_access_group/static/description/icon.png differ diff --git a/document_page_access_group/static/description/index.html b/document_page_access_group/static/description/index.html new file mode 100644 index 00000000..3363ee7e --- /dev/null +++ b/document_page_access_group/static/description/index.html @@ -0,0 +1,431 @@ + + + + + + +Document Page Access Group + + + +
+

Document Page Access Group

+ + +

Beta License: AGPL-3 OCA/knowledge Translate me on Weblate Try me on Runbot

+

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

+

Table of contents

+ +
+

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. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Sygel
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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 project on GitHub.

+

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

+
+
+
+ + diff --git a/document_page_access_group/views/document_page.xml b/document_page_access_group/views/document_page.xml new file mode 100644 index 00000000..b09cba7d --- /dev/null +++ b/document_page_access_group/views/document_page.xml @@ -0,0 +1,21 @@ + + + + + document.page.access.group.view.wiki.form + document.page + + + + + + + + + +