@opengis/fastify-table 1.2.10 → 1.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
create schema if not exists admin;
|
|
2
|
+
|
|
3
|
+
-- DROP TABLE is exists admin.templates;
|
|
4
|
+
CREATE TABLE if not exists admin.templates();
|
|
5
|
+
ALTER TABLE admin.templates add column if not exists template_id text NOT NULL DEFAULT next_id();
|
|
6
|
+
ALTER TABLE admin.templates DROP CONSTRAINT if exists admin_templates_template_id_pkey cascade;
|
|
7
|
+
ALTER TABLE admin.templates DROP CONSTRAINT if exists admin_templates_name_type_unique;
|
|
8
|
+
|
|
9
|
+
ALTER TABLE admin.templates add column if not exists name text;
|
|
10
|
+
ALTER TABLE admin.templates add column if not exists title text;
|
|
11
|
+
ALTER TABLE admin.templates add column if not exists type text;
|
|
12
|
+
ALTER TABLE admin.templates add column if not exists route_id text;
|
|
13
|
+
ALTER TABLE admin.templates add column if not exists enabled boolean;
|
|
14
|
+
ALTER TABLE admin.templates alter column enabled set default true;
|
|
15
|
+
ALTER TABLE admin.templates add column if not exists body text;
|
|
16
|
+
|
|
17
|
+
ALTER TABLE admin.templates add column if not exists uid text;
|
|
18
|
+
ALTER TABLE admin.templates add column if not exists cdate timestamp without time zone DEFAULT date_trunc('seconds'::text, now());
|
|
19
|
+
ALTER TABLE admin.templates alter column cdate set DEFAULT date_trunc('seconds'::text, now());
|
|
20
|
+
ALTER TABLE admin.templates add column if not exists editor_id text;
|
|
21
|
+
ALTER TABLE admin.templates add column if not exists editor_date timestamp without time zone;
|
|
22
|
+
|
|
23
|
+
ALTER TABLE admin.templates add CONSTRAINT admin_templates_template_id_pkey PRIMARY KEY (template_id);
|
|
24
|
+
ALTER TABLE admin.templates add CONSTRAINT admin_templates_name_type_unique UNIQUE (name, type);
|
|
25
|
+
|
|
26
|
+
COMMENT ON TABLE admin.templates IS 'Шаблони для друку';
|
|
27
|
+
|
|
28
|
+
COMMENT ON COLUMN admin.templates.uid IS 'ID користувача';
|
|
29
|
+
|
|
30
|
+
COMMENT ON COLUMN admin.templates.name IS 'Систамна назва шаблону';
|
|
31
|
+
COMMENT ON COLUMN admin.templates.title IS 'Назва шаблону українською';
|
|
32
|
+
COMMENT ON COLUMN admin.templates.type IS 'Тип вихідних даних шаблону (demo/user)';
|
|
33
|
+
COMMENT ON COLUMN admin.templates.route_id IS 'ID інтерфейсу';
|
|
34
|
+
COMMENT ON COLUMN admin.templates.enabled IS 'On / Off';
|
|
35
|
+
COMMENT ON COLUMN admin.templates.body IS 'Body HTML';
|
|
@@ -27,9 +27,9 @@ export default function checkPolicy(req, reply) {
|
|
|
27
27
|
const { policy = [] } = routeOptions?.config || {};
|
|
28
28
|
|
|
29
29
|
/*= == 0.Check superadmin access === */
|
|
30
|
-
if (policy.includes('
|
|
30
|
+
if (policy.includes('admin') && user?.user_type !== 'admin') {
|
|
31
31
|
logger.file('policy/access', {
|
|
32
|
-
path, method, params, query, body, message: 'access restricted: not
|
|
32
|
+
path, method, params, query, body, message: 'access restricted: not admin', uid: user?.uid,
|
|
33
33
|
});
|
|
34
34
|
return reply.status(403).send('access restricted: 0');
|
|
35
35
|
}
|