Skip to content

Commit 7c37639

Browse files
aleuffrePicchiSeba
authored andcommitted
[IMP] base_rest: show first-level menu to admins only
1 parent c89c938 commit 7c37639

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

base_rest/README.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ systems, therefore increasing maintenance costs.
4646
Once developed, an `OpenApi <https://spec.openapis.org/oas/v3.0.3>`_ documentation
4747
is generated from the source code and available via a
4848
`Swagger UI <https://swagger.io/tools/swagger-ui/>`_ served by your odoo server
49-
at `https://my_odoo_server/api-docs`.
49+
at `https://my_odoo_server/api-docs`. There is also a convenience menu
50+
visible by users with permission "Administration: Settings", but the
51+
docs endpoint itself is public.
5052

5153
**Table of contents**
5254

base_rest/readme/DESCRIPTION.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ systems, therefore increasing maintenance costs.
1616
Once developed, an `OpenApi <https://spec.openapis.org/oas/v3.0.3>`_ documentation
1717
is generated from the source code and available via a
1818
`Swagger UI <https://swagger.io/tools/swagger-ui/>`_ served by your odoo server
19-
at `https://my_odoo_server/api-docs`.
19+
at `https://my_odoo_server/api-docs`. There is also a convenience menu
20+
visible by users with permission "Administration: Settings", but the
21+
docs endpoint itself is public.

base_rest/static/description/index.html

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml version="1.0" encoding="utf-8"?>
21
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
32
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
43
<head>
@@ -9,10 +8,11 @@
98

109
/*
1110
:Author: David Goodger (goodger@python.org)
12-
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
11+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
1312
:Copyright: This stylesheet has been placed in the public domain.
1413
1514
Default cascading style sheet for the HTML output of Docutils.
15+
Despite the name, some widely supported CSS2 features are used.
1616
1717
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1818
customize this style sheet.
@@ -275,7 +275,7 @@
275275
margin-left: 2em ;
276276
margin-right: 2em }
277277

278-
pre.code .ln { color: grey; } /* line numbers */
278+
pre.code .ln { color: gray; } /* line numbers */
279279
pre.code, code { background-color: #eeeeee }
280280
pre.code .comment, code .comment { color: #5C6576 }
281281
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +301,7 @@
301301
span.pre {
302302
white-space: pre }
303303

304-
span.problematic {
304+
span.problematic, pre.problematic {
305305
color: red }
306306

307307
span.section-subtitle {
@@ -384,7 +384,9 @@ <h1 class="title">Base Rest</h1>
384384
<p>Once developed, an <a class="reference external" href="https://spec.openapis.org/oas/v3.0.3">OpenApi</a> documentation
385385
is generated from the source code and available via a
386386
<a class="reference external" href="https://swagger.io/tools/swagger-ui/">Swagger UI</a> served by your odoo server
387-
at <cite>https://my_odoo_server/api-docs</cite>.</p>
387+
at <cite>https://my_odoo_server/api-docs</cite>. There is also a convenience menu
388+
visible by users with permission “Administration: Settings”, but the
389+
docs endpoint itself is public.</p>
388390
<p><strong>Table of contents</strong></p>
389391
<div class="contents local topic" id="contents">
390392
<ul class="simple">
@@ -738,7 +740,9 @@ <h2><a class="toc-backref" href="#toc-entry-13">Contributors</a></h2>
738740
<div class="section" id="maintainers">
739741
<h2><a class="toc-backref" href="#toc-entry-14">Maintainers</a></h2>
740742
<p>This module is maintained by the OCA.</p>
741-
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
743+
<a class="reference external image-reference" href="https://odoo-community.org">
744+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
745+
</a>
742746
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
743747
mission is to support the collaborative development of Odoo features and
744748
promote its widespread use.</p>

base_rest/views/base_rest_view.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<!-- Copyright 2018 ACSONE SA/NV
33
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
44
<odoo>
5-
65
<record id="menu_rest_api_root" model="ir.ui.menu">
76
<field name="name">REST API</field>
87
<field name="sequence" eval="400" />
98
<field name="web_icon">base_rest,static/description/icon.png</field>
9+
<field name="groups_id" eval="[(4, ref('base.group_system'))]" />
1010
</record>
1111

1212
<record id="action_rest_api_docs" model="ir.actions.act_url">

0 commit comments

Comments
 (0)