]> git.openstreetmap.org Git - nominatim.git/blob - lib-sql/grants.sql
sanity check class names before inserting into classtype tables
[nominatim.git] / lib-sql / grants.sql
1 -- SPDX-License-Identifier: GPL-2.0-only
2 --
3 -- This file is part of Nominatim. (https://nominatim.org)
4 --
5 -- Copyright (C) 2026 by the Nominatim developer community.
6 -- For a full list of authors see the git log.
7 --
8 -- Grant read-only access to the web user for all Nominatim tables.
9
10 -- Core tables
11 GRANT SELECT ON import_status TO "{{config.DATABASE_WEBUSER}}";
12 GRANT SELECT ON country_name TO "{{config.DATABASE_WEBUSER}}";
13 GRANT SELECT ON nominatim_properties TO "{{config.DATABASE_WEBUSER}}";
14
15 -- Location tables
16 GRANT SELECT ON location_property_tiger TO "{{config.DATABASE_WEBUSER}}";
17 GRANT SELECT ON location_property_osmline TO "{{config.DATABASE_WEBUSER}}";
18 GRANT SELECT ON location_postcodes TO "{{config.DATABASE_WEBUSER}}";
19
20 -- Search tables
21 {% if not db.reverse_only %}
22 GRANT SELECT ON search_name TO "{{config.DATABASE_WEBUSER}}";
23 {% endif %}
24
25 -- Main place tables
26 GRANT SELECT ON placex TO "{{config.DATABASE_WEBUSER}}";
27 GRANT SELECT ON place_addressline TO "{{config.DATABASE_WEBUSER}}";
28 GRANT SELECT ON placex_entrance TO "{{config.DATABASE_WEBUSER}}";
29
30 -- Error/delete tracking tables
31 GRANT SELECT ON import_polygon_error TO "{{config.DATABASE_WEBUSER}}";
32 GRANT SELECT ON import_polygon_delete TO "{{config.DATABASE_WEBUSER}}";
33
34 -- Country grid
35 GRANT SELECT ON country_osm_grid TO "{{config.DATABASE_WEBUSER}}";
36
37 -- Tokenizer tables (word table)
38 {% if 'word' in db.tables %}
39 GRANT SELECT ON word TO "{{config.DATABASE_WEBUSER}}";
40 {% endif %}
41
42 -- Special phrase tables
43 {% for table in db.tables %}
44 {% if table.startswith('place_classtype_') %}
45 GRANT SELECT ON {{ table }} TO "{{config.DATABASE_WEBUSER}}";
46 {% endif %}
47 {% endfor %}