You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

0.1.0_01_struct_init.sql 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  1. --
  2. -- PostgreSQL database dump
  3. --
  4. --
  5. -- Name: camera_types; Type: TABLE; Schema: public; Owner: dev; Tablespace:
  6. --
  7. CREATE TABLE camera_types (
  8. id integer NOT NULL,
  9. name character varying(128) NOT NULL,
  10. class character varying(128) NOT NULL,
  11. default_data text NOT NULL
  12. );
  13. --
  14. -- Name: camera_types_id_seq; Type: SEQUENCE; Schema: public; Owner: dev
  15. --
  16. CREATE SEQUENCE camera_types_id_seq
  17. START WITH 1
  18. INCREMENT BY 1
  19. NO MINVALUE
  20. NO MAXVALUE
  21. CACHE 1;
  22. --
  23. -- Name: camera_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dev
  24. --
  25. ALTER SEQUENCE camera_types_id_seq OWNED BY camera_types.id;
  26. --
  27. -- Name: cameras; Type: TABLE; Schema: public; Owner: dev; Tablespace:
  28. --
  29. CREATE TABLE cameras (
  30. id integer NOT NULL,
  31. name character varying(128) NOT NULL,
  32. description character varying(256) NOT NULL,
  33. host_id integer NOT NULL,
  34. camera_type_id integer NOT NULL,
  35. data text NOT NULL
  36. );
  37. --
  38. -- Name: cameras_id_seq; Type: SEQUENCE; Schema: public; Owner: dev
  39. --
  40. CREATE SEQUENCE cameras_id_seq
  41. START WITH 1
  42. INCREMENT BY 1
  43. NO MINVALUE
  44. NO MAXVALUE
  45. CACHE 1;
  46. --
  47. -- Name: cameras_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dev
  48. --
  49. ALTER SEQUENCE cameras_id_seq OWNED BY cameras.id;
  50. --
  51. -- Name: command_types; Type: TABLE; Schema: public; Owner: dev; Tablespace:
  52. --
  53. CREATE TABLE command_types (
  54. id integer NOT NULL,
  55. name character varying(128) NOT NULL,
  56. class character varying(128) NOT NULL,
  57. default_data text NOT NULL
  58. );
  59. --
  60. -- Name: command_types_id_seq; Type: SEQUENCE; Schema: public; Owner: dev
  61. --
  62. CREATE SEQUENCE command_types_id_seq
  63. START WITH 1
  64. INCREMENT BY 1
  65. NO MINVALUE
  66. NO MAXVALUE
  67. CACHE 1;
  68. --
  69. -- Name: command_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dev
  70. --
  71. ALTER SEQUENCE command_types_id_seq OWNED BY command_types.id;
  72. --
  73. -- Name: commands; Type: TABLE; Schema: public; Owner: dev; Tablespace:
  74. --
  75. CREATE TABLE commands (
  76. id integer NOT NULL,
  77. name character varying(128) NOT NULL,
  78. description character varying(256) NOT NULL,
  79. host_id integer NOT NULL,
  80. command_type_id integer NOT NULL,
  81. data text NOT NULL
  82. );
  83. --
  84. -- Name: commands_id_seq; Type: SEQUENCE; Schema: public; Owner: dev
  85. --
  86. CREATE SEQUENCE commands_id_seq
  87. START WITH 1
  88. INCREMENT BY 1
  89. NO MINVALUE
  90. NO MAXVALUE
  91. CACHE 1;
  92. --
  93. -- Name: commands_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dev
  94. --
  95. ALTER SEQUENCE commands_id_seq OWNED BY commands.id;
  96. --
  97. -- Name: hosts; Type: TABLE; Schema: public; Owner: dev; Tablespace:
  98. --
  99. CREATE TABLE hosts (
  100. id integer NOT NULL,
  101. name character varying(128) NOT NULL,
  102. url character varying(256) NOT NULL,
  103. token character varying(128) NOT NULL
  104. );
  105. --
  106. -- Name: hosts_id_seq; Type: SEQUENCE; Schema: public; Owner: dev
  107. --
  108. CREATE SEQUENCE hosts_id_seq
  109. START WITH 1
  110. INCREMENT BY 1
  111. NO MINVALUE
  112. NO MAXVALUE
  113. CACHE 1;
  114. --
  115. -- Name: hosts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dev
  116. --
  117. ALTER SEQUENCE hosts_id_seq OWNED BY hosts.id;
  118. --
  119. -- Name: luticate_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: dev
  120. --
  121. CREATE SEQUENCE luticate_groups_id_seq
  122. START WITH 1
  123. INCREMENT BY 1
  124. NO MINVALUE
  125. NO MAXVALUE
  126. CACHE 1;
  127. --
  128. -- Name: luticate_groups; Type: TABLE; Schema: public; Owner: dev; Tablespace:
  129. --
  130. CREATE TABLE luticate_groups (
  131. id integer DEFAULT nextval('luticate_groups_id_seq'::regclass) NOT NULL,
  132. name character varying NOT NULL
  133. );
  134. --
  135. -- Name: luticate_permissions; Type: TABLE; Schema: public; Owner: dev; Tablespace:
  136. --
  137. CREATE TABLE luticate_permissions (
  138. name character varying(128) NOT NULL,
  139. value boolean NOT NULL
  140. );
  141. --
  142. -- Name: luticate_permissions_groups; Type: TABLE; Schema: public; Owner: dev; Tablespace:
  143. --
  144. CREATE TABLE luticate_permissions_groups (
  145. name character varying(128) NOT NULL,
  146. value boolean NOT NULL,
  147. group_id integer NOT NULL
  148. );
  149. --
  150. -- Name: luticate_permissions_users; Type: TABLE; Schema: public; Owner: dev; Tablespace:
  151. --
  152. CREATE TABLE luticate_permissions_users (
  153. name character varying(128) NOT NULL,
  154. value boolean,
  155. user_id integer NOT NULL
  156. );
  157. --
  158. -- Name: luticate_users_id_seq; Type: SEQUENCE; Schema: public; Owner: dev
  159. --
  160. CREATE SEQUENCE luticate_users_id_seq
  161. START WITH 1
  162. INCREMENT BY 1
  163. NO MINVALUE
  164. NO MAXVALUE
  165. CACHE 1;
  166. --
  167. -- Name: luticate_users; Type: TABLE; Schema: public; Owner: dev; Tablespace:
  168. --
  169. CREATE TABLE luticate_users (
  170. id integer DEFAULT nextval('luticate_users_id_seq'::regclass) NOT NULL,
  171. username character varying(255) NOT NULL,
  172. email character varying(255) NOT NULL,
  173. password character varying(255) NOT NULL,
  174. salt character varying(10) NOT NULL,
  175. profile_id integer,
  176. firstname character varying(255) NOT NULL,
  177. lastname character varying(255) NOT NULL
  178. );
  179. --
  180. -- Name: luticate_users_groups; Type: TABLE; Schema: public; Owner: dev; Tablespace:
  181. --
  182. CREATE TABLE luticate_users_groups (
  183. user_id integer NOT NULL,
  184. group_id integer NOT NULL
  185. );
  186. --
  187. -- Name: sensor_types; Type: TABLE; Schema: public; Owner: dev; Tablespace:
  188. --
  189. CREATE TABLE sensor_types (
  190. id integer NOT NULL,
  191. name character varying(128) NOT NULL,
  192. class character varying(128) NOT NULL,
  193. default_data text NOT NULL
  194. );
  195. --
  196. -- Name: sensor_types_id_seq; Type: SEQUENCE; Schema: public; Owner: dev
  197. --
  198. CREATE SEQUENCE sensor_types_id_seq
  199. START WITH 1
  200. INCREMENT BY 1
  201. NO MINVALUE
  202. NO MAXVALUE
  203. CACHE 1;
  204. --
  205. -- Name: sensor_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dev
  206. --
  207. ALTER SEQUENCE sensor_types_id_seq OWNED BY sensor_types.id;
  208. --
  209. -- Name: sensors; Type: TABLE; Schema: public; Owner: dev; Tablespace:
  210. --
  211. CREATE TABLE sensors (
  212. id integer NOT NULL,
  213. name character varying(128) NOT NULL,
  214. description character varying(256) NOT NULL,
  215. host_id integer NOT NULL,
  216. sensor_type_id integer NOT NULL,
  217. data text NOT NULL
  218. );
  219. --
  220. -- Name: sensors_id_seq; Type: SEQUENCE; Schema: public; Owner: dev
  221. --
  222. CREATE SEQUENCE sensors_id_seq
  223. START WITH 1
  224. INCREMENT BY 1
  225. NO MINVALUE
  226. NO MAXVALUE
  227. CACHE 1;
  228. --
  229. -- Name: sensors_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dev
  230. --
  231. ALTER SEQUENCE sensors_id_seq OWNED BY sensors.id;
  232. --
  233. -- Name: id; Type: DEFAULT; Schema: public; Owner: dev
  234. --
  235. ALTER TABLE ONLY camera_types ALTER COLUMN id SET DEFAULT nextval('camera_types_id_seq'::regclass);
  236. --
  237. -- Name: id; Type: DEFAULT; Schema: public; Owner: dev
  238. --
  239. ALTER TABLE ONLY cameras ALTER COLUMN id SET DEFAULT nextval('cameras_id_seq'::regclass);
  240. --
  241. -- Name: id; Type: DEFAULT; Schema: public; Owner: dev
  242. --
  243. ALTER TABLE ONLY command_types ALTER COLUMN id SET DEFAULT nextval('command_types_id_seq'::regclass);
  244. --
  245. -- Name: id; Type: DEFAULT; Schema: public; Owner: dev
  246. --
  247. ALTER TABLE ONLY commands ALTER COLUMN id SET DEFAULT nextval('commands_id_seq'::regclass);
  248. --
  249. -- Name: id; Type: DEFAULT; Schema: public; Owner: dev
  250. --
  251. ALTER TABLE ONLY hosts ALTER COLUMN id SET DEFAULT nextval('hosts_id_seq'::regclass);
  252. --
  253. -- Name: id; Type: DEFAULT; Schema: public; Owner: dev
  254. --
  255. ALTER TABLE ONLY sensor_types ALTER COLUMN id SET DEFAULT nextval('sensor_types_id_seq'::regclass);
  256. --
  257. -- Name: id; Type: DEFAULT; Schema: public; Owner: dev
  258. --
  259. ALTER TABLE ONLY sensors ALTER COLUMN id SET DEFAULT nextval('sensors_id_seq'::regclass);
  260. --
  261. -- Name: camera_types_name_key; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  262. --
  263. ALTER TABLE ONLY camera_types
  264. ADD CONSTRAINT camera_types_name_key UNIQUE (name);
  265. --
  266. -- Name: camera_types_pkey; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  267. --
  268. ALTER TABLE ONLY camera_types
  269. ADD CONSTRAINT camera_types_pkey PRIMARY KEY (id);
  270. --
  271. -- Name: cameras_name_key; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  272. --
  273. ALTER TABLE ONLY cameras
  274. ADD CONSTRAINT cameras_name_key UNIQUE (name);
  275. --
  276. -- Name: cameras_pkey; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  277. --
  278. ALTER TABLE ONLY cameras
  279. ADD CONSTRAINT cameras_pkey PRIMARY KEY (id);
  280. --
  281. -- Name: command_types_name_key; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  282. --
  283. ALTER TABLE ONLY command_types
  284. ADD CONSTRAINT command_types_name_key UNIQUE (name);
  285. --
  286. -- Name: command_types_pkey; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  287. --
  288. ALTER TABLE ONLY command_types
  289. ADD CONSTRAINT command_types_pkey PRIMARY KEY (id);
  290. --
  291. -- Name: commands_name_key; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  292. --
  293. ALTER TABLE ONLY commands
  294. ADD CONSTRAINT commands_name_key UNIQUE (name);
  295. --
  296. -- Name: commands_pkey; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  297. --
  298. ALTER TABLE ONLY commands
  299. ADD CONSTRAINT commands_pkey PRIMARY KEY (id);
  300. --
  301. -- Name: hosts_name_key; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  302. --
  303. ALTER TABLE ONLY hosts
  304. ADD CONSTRAINT hosts_name_key UNIQUE (name);
  305. --
  306. -- Name: hosts_pkey; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  307. --
  308. ALTER TABLE ONLY hosts
  309. ADD CONSTRAINT hosts_pkey PRIMARY KEY (id);
  310. --
  311. -- Name: luticate_groups_name_key; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  312. --
  313. ALTER TABLE ONLY luticate_groups
  314. ADD CONSTRAINT luticate_groups_name_key UNIQUE (name);
  315. --
  316. -- Name: luticate_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  317. --
  318. ALTER TABLE ONLY luticate_groups
  319. ADD CONSTRAINT luticate_groups_pkey PRIMARY KEY (id);
  320. --
  321. -- Name: luticate_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  322. --
  323. ALTER TABLE ONLY luticate_permissions
  324. ADD CONSTRAINT luticate_permissions_pkey PRIMARY KEY (name);
  325. --
  326. -- Name: luticate_permissions_users_pkey; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  327. --
  328. ALTER TABLE ONLY luticate_permissions_users
  329. ADD CONSTRAINT luticate_permissions_users_pkey PRIMARY KEY (name, user_id);
  330. --
  331. -- Name: luticate_users_email_key; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  332. --
  333. ALTER TABLE ONLY luticate_users
  334. ADD CONSTRAINT luticate_users_email_key UNIQUE (email);
  335. --
  336. -- Name: luticate_users_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  337. --
  338. ALTER TABLE ONLY luticate_users_groups
  339. ADD CONSTRAINT luticate_users_groups_pkey PRIMARY KEY (user_id, group_id);
  340. --
  341. -- Name: luticate_users_pkey; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  342. --
  343. ALTER TABLE ONLY luticate_users
  344. ADD CONSTRAINT luticate_users_pkey PRIMARY KEY (id);
  345. --
  346. -- Name: luticate_users_username_key; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  347. --
  348. ALTER TABLE ONLY luticate_users
  349. ADD CONSTRAINT luticate_users_username_key UNIQUE (username);
  350. --
  351. -- Name: pkey; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  352. --
  353. ALTER TABLE ONLY luticate_permissions_groups
  354. ADD CONSTRAINT pkey PRIMARY KEY (name, group_id);
  355. --
  356. -- Name: sensor_types_name_key; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  357. --
  358. ALTER TABLE ONLY sensor_types
  359. ADD CONSTRAINT sensor_types_name_key UNIQUE (name);
  360. --
  361. -- Name: sensor_types_pkey; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  362. --
  363. ALTER TABLE ONLY sensor_types
  364. ADD CONSTRAINT sensor_types_pkey PRIMARY KEY (id);
  365. --
  366. -- Name: sensors_name_key; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  367. --
  368. ALTER TABLE ONLY sensors
  369. ADD CONSTRAINT sensors_name_key UNIQUE (name);
  370. --
  371. -- Name: sensors_pkey; Type: CONSTRAINT; Schema: public; Owner: dev; Tablespace:
  372. --
  373. ALTER TABLE ONLY sensors
  374. ADD CONSTRAINT sensors_pkey PRIMARY KEY (id);
  375. --
  376. -- Name: cameras_camera_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dev
  377. --
  378. ALTER TABLE ONLY cameras
  379. ADD CONSTRAINT cameras_camera_type_id_fkey FOREIGN KEY (camera_type_id) REFERENCES camera_types(id);
  380. --
  381. -- Name: cameras_host_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dev
  382. --
  383. ALTER TABLE ONLY cameras
  384. ADD CONSTRAINT cameras_host_id_fkey FOREIGN KEY (host_id) REFERENCES hosts(id) ON DELETE CASCADE;
  385. --
  386. -- Name: commands_command_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dev
  387. --
  388. ALTER TABLE ONLY commands
  389. ADD CONSTRAINT commands_command_type_id_fkey FOREIGN KEY (command_type_id) REFERENCES command_types(id) ON DELETE CASCADE;
  390. --
  391. -- Name: commands_host_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dev
  392. --
  393. ALTER TABLE ONLY commands
  394. ADD CONSTRAINT commands_host_id_fkey FOREIGN KEY (host_id) REFERENCES hosts(id) ON DELETE CASCADE;
  395. --
  396. -- Name: foreign_group; Type: FK CONSTRAINT; Schema: public; Owner: dev
  397. --
  398. ALTER TABLE ONLY luticate_permissions_groups
  399. ADD CONSTRAINT foreign_group FOREIGN KEY (group_id) REFERENCES luticate_groups(id) ON DELETE CASCADE;
  400. --
  401. -- Name: foreign_group; Type: FK CONSTRAINT; Schema: public; Owner: dev
  402. --
  403. ALTER TABLE ONLY luticate_users_groups
  404. ADD CONSTRAINT foreign_group FOREIGN KEY (group_id) REFERENCES luticate_groups(id) ON DELETE CASCADE;
  405. --
  406. -- Name: foreign_name; Type: FK CONSTRAINT; Schema: public; Owner: dev
  407. --
  408. ALTER TABLE ONLY luticate_permissions_groups
  409. ADD CONSTRAINT foreign_name FOREIGN KEY (name) REFERENCES luticate_permissions(name) ON DELETE CASCADE;
  410. --
  411. -- Name: foreign_name; Type: FK CONSTRAINT; Schema: public; Owner: dev
  412. --
  413. ALTER TABLE ONLY luticate_permissions_users
  414. ADD CONSTRAINT foreign_name FOREIGN KEY (name) REFERENCES luticate_permissions(name) ON DELETE CASCADE;
  415. --
  416. -- Name: foreign_user; Type: FK CONSTRAINT; Schema: public; Owner: dev
  417. --
  418. ALTER TABLE ONLY luticate_permissions_users
  419. ADD CONSTRAINT foreign_user FOREIGN KEY (user_id) REFERENCES luticate_users(id) ON DELETE CASCADE;
  420. --
  421. -- Name: foreign_user; Type: FK CONSTRAINT; Schema: public; Owner: dev
  422. --
  423. ALTER TABLE ONLY luticate_users_groups
  424. ADD CONSTRAINT foreign_user FOREIGN KEY (user_id) REFERENCES luticate_users(id) ON DELETE CASCADE;
  425. --
  426. -- Name: sensors_host_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dev
  427. --
  428. ALTER TABLE ONLY sensors
  429. ADD CONSTRAINT sensors_host_id_fkey FOREIGN KEY (host_id) REFERENCES hosts(id) ON DELETE CASCADE;
  430. --
  431. -- Name: sensors_sensor_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dev
  432. --
  433. ALTER TABLE ONLY sensors
  434. ADD CONSTRAINT sensors_sensor_type_id_fkey FOREIGN KEY (sensor_type_id) REFERENCES sensor_types(id) ON DELETE CASCADE;
  435. --
  436. -- Name: sp_lu_get_user_permission(integer, character varying); Type: FUNCTION; Schema: public; Owner: dev
  437. --
  438. CREATE FUNCTION sp_lu_get_user_permission(_user_id integer, _permisson_name character varying, OUT val boolean) RETURNS boolean
  439. LANGUAGE plpgsql IMMUTABLE SECURITY DEFINER COST 10
  440. AS $$
  441. DECLARE
  442. groups int[];
  443. g INT;
  444. BEGIN
  445. SELECT "value" INTO val FROM luticate_permissions_users WHERE "user_id" = _user_id AND "name" = _permisson_name;
  446. IF val is null THEN
  447. SELECT lpg."value" into val FROM luticate_permissions_groups lpg
  448. INNER JOIN luticate_groups lg ON lg."id" = lpg."group_id"
  449. INNER JOIN luticate_users_groups lug ON lug."user_id" = _user_id AND lug."group_id" = lg."id"
  450. WHERE lpg."name" = _permisson_name and lpg."value" = FALSE;
  451. IF val is null then
  452. SELECT lpg."value" into val FROM luticate_permissions_groups lpg
  453. INNER JOIN luticate_groups lg ON lg."id" = lpg."group_id"
  454. INNER JOIN luticate_users_groups lug ON lug."user_id" = _user_id AND lug."group_id" = lg."id"
  455. WHERE lpg."name" = _permisson_name and lpg."value" = TRUE;
  456. IF val is null then
  457. SELECT "value" INTO val FROM luticate_permissions WHERE "name" = _permisson_name;
  458. END IF;
  459. end if;
  460. END IF;
  461. END;
  462. $$;
  463. --
  464. -- Name: sp_lu_get_all_user_permission(integer); Type: FUNCTION; Schema: public; Owner: dev
  465. --
  466. CREATE FUNCTION sp_lu_get_all_user_permission(_user_id integer, OUT _permisson_name character varying, OUT val boolean) RETURNS SETOF record
  467. LANGUAGE sql IMMUTABLE SECURITY DEFINER COST 10
  468. AS $$
  469. SELECT p.name, sp_lu_get_user_permission(_user_id, p.name) FROM luticate_permissions p ORDER bY p.name
  470. $$;
  471. --
  472. -- Name: public; Type: ACL; Schema: -; Owner: postgres
  473. --
  474. --
  475. -- PostgreSQL database dump complete
  476. --