summaryrefslogtreecommitdiff
path: root/sql/modules/Roles.sql
blob: 0629c80a11d362044efa7fd22beca9e3b4ff397a (plain)
  1. -- Contacts
  2. CREATE ROLE lsmb_<?lsmb dbname ?>__read_contact
  3. WITH INHERIT NOLOGIN;
  4. GRANT SELECT ON entity TO lsmb_<?lsmb dbname ?>__read_contact;
  5. GRANT SELECT ON company TO lsmb_<?lsmb dbname ?>__read_contact;
  6. GRANT SELECT ON location TO lsmb_<?lsmb dbname ?>__read_contact;
  7. GRANT SELECT ON person TO lsmb_<?lsmb dbname ?>__read_contact;
  8. GRANT SELECT ON entity_credit_account TO lsmb_<?lsmb dbname ?>__read_contact;
  9. GRANT SELECT ON company_to_contact TO lsmb_<?lsmb dbname ?>__read_contact;
  10. GRANT SELECT ON company_to_entity TO lsmb_<?lsmb dbname ?>__read_contact;
  11. GRANT SELECT ON company_to_location TO lsmb_<?lsmb dbname ?>__read_contact;
  12. GRANT SELECT ON customertax TO lsmb_<?lsmb dbname ?>__read_contact;
  13. GRANT SELECT ON employee TO lsmb_<?lsmb dbname ?>__read_contact;
  14. GRANT SELECT ON customer TO lsmb_<?lsmb dbname ?>__read_contact;
  15. GRANT SELECT ON contact_class TO lsmb_<?lsmb dbname ?>__read_contact;
  16. GRANT SELECT ON entity_class TO lsmb_<?lsmb dbname ?>__read_contact;
  17. GRANT SELECT ON entity_bank_account TO lsmb_<?lsmb dbname ?>__read_contact;
  18. GRANT SELECT ON entity_note TO lsmb_<?lsmb dbname ?>__read_contact;
  19. GRANT SELECT ON entity_class_to_entity TO lsmb_<?lsmb dbname ?>__read_contact;
  20. GRANT SELECT ON entity_other_name TO lsmb_<?lsmb dbname ?>__read_contact;
  21. GRANT SELECT ON location_class TO lsmb_<?lsmb dbname ?>__read_contact;
  22. GRANT SELECT ON person_to_company TO lsmb_<?lsmb dbname ?>__read_contact;
  23. GRANT SELECT ON person_to_contact TO lsmb_<?lsmb dbname ?>__read_contact;
  24. GRANT SELECT ON person_to_contact TO lsmb_<?lsmb dbname ?>__read_contact;
  25. GRANT SELECT ON person_to_location TO lsmb_<?lsmb dbname ?>__read_contact;
  26. GRANT SELECT ON person_to_location TO lsmb_<?lsmb dbname ?>__read_contact;
  27. GRANT SELECT ON vendortax TO lsmb_<?lsmb dbname ?>__read_contact;
  28. INSERT INTO menu_acl (node_id, acl_type, role_name)
  29. values (1, 'allow', 'lsmb_<?lsmb dbname ?>__read_contact');
  30. INSERT INTO menu_acl (node_id, acl_type, role_name)
  31. values (11, 'allow', 'lsmb_<?lsmb dbname ?>__read_contact');
  32. INSERT INTO menu_acl (node_id, acl_type, role_name)
  33. values (14, 'allow', 'lsmb_<?lsmb dbname ?>__read_contact');
  34. INSERT INTO menu_acl (node_id, acl_type, role_name)
  35. values (21, 'allow', 'lsmb_<?lsmb dbname ?>__read_contact');
  36. INSERT INTO menu_acl (node_id, acl_type, role_name)
  37. values (30, 'allow', 'lsmb_<?lsmb dbname ?>__read_contact');
  38. INSERT INTO menu_acl (node_id, acl_type, role_name)
  39. values (33, 'allow', 'lsmb_<?lsmb dbname ?>__read_contact');
  40. CREATE ROLE lsmb_<?lsmb dbname ?>__create_contact
  41. WITH INHERIT NOLOGIN
  42. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  43. GRANT INSERT ON entity TO lsmb_<?lsmb dbname ?>__create_contact;
  44. GRANT ALL ON entity_id_seq TO lsmb_<?lsmb dbname ?>__create_contact;
  45. GRANT INSERT ON company TO lsmb_<?lsmb dbname ?>__create_contact;
  46. GRANT ALL ON company_id_seq TO lsmb_<?lsmb dbname ?>__create_contact;
  47. GRANT INSERT ON location TO lsmb_<?lsmb dbname ?>__create_contact;
  48. GRANT ALL ON location_id_seq TO lsmb_<?lsmb dbname ?>__create_contact;
  49. GRANT INSERT ON person TO lsmb_<?lsmb dbname ?>__create_contact;
  50. GRANT ALL ON person_id_seq TO lsmb_<?lsmb dbname ?>__create_contact;
  51. GRANT INSERT ON entity_credit_account TO lsmb_<?lsmb dbname ?>__create_contact;
  52. GRANT ALL ON entity_credit_account_id_seq TO lsmb_<?lsmb dbname ?>__create_contact;
  53. GRANT INSERT ON company_to_contact TO lsmb_<?lsmb dbname ?>__create_contact;
  54. GRANT INSERT ON company_to_entity TO lsmb_<?lsmb dbname ?>__create_contact;
  55. GRANT INSERT ON company_to_location TO lsmb_<?lsmb dbname ?>__create_contact;
  56. GRANT INSERT ON customertax TO lsmb_<?lsmb dbname ?>__create_contact;
  57. GRANT INSERT ON employee TO lsmb_<?lsmb dbname ?>__create_contact;
  58. GRANT INSERT ON customer TO lsmb_<?lsmb dbname ?>__create_contact;
  59. GRANT INSERT ON entity_bank_account TO lsmb_<?lsmb dbname ?>__create_contact;
  60. GRANT ALL ON entity_bank_account_id_seq TO lsmb_<?lsmb dbname ?>__create_contact;
  61. GRANT INSERT ON entity_note TO lsmb_<?lsmb dbname ?>__create_contact;
  62. GRANT INSERT ON entity_class_to_entity TO lsmb_<?lsmb dbname ?>__create_contact;
  63. GRANT INSERT ON entity_other_name TO lsmb_<?lsmb dbname ?>__create_contact;
  64. GRANT INSERT ON person_to_company TO lsmb_<?lsmb dbname ?>__create_contact;
  65. GRANT INSERT ON person_to_contact TO lsmb_<?lsmb dbname ?>__create_contact;
  66. GRANT INSERT ON person_to_contact TO lsmb_<?lsmb dbname ?>__create_contact;
  67. GRANT INSERT ON person_to_location TO lsmb_<?lsmb dbname ?>__create_contact;
  68. GRANT INSERT ON person_to_location TO lsmb_<?lsmb dbname ?>__create_contact;
  69. GRANT INSERT ON vendortax TO lsmb_<?lsmb dbname ?>__create_contact;
  70. INSERT INTO menu_acl (node_id, acl_type, role_name)
  71. values (1, 'allow', 'lsmb_<?lsmb dbname ?>__create_contact');
  72. INSERT INTO menu_acl (node_id, acl_type, role_name)
  73. values (11, 'allow', 'lsmb_<?lsmb dbname ?>__create_contact');
  74. INSERT INTO menu_acl (node_id, acl_type, role_name)
  75. values (12, 'allow', 'lsmb_<?lsmb dbname ?>__create_contact');
  76. INSERT INTO menu_acl (node_id, acl_type, role_name)
  77. values (21, 'allow', 'lsmb_<?lsmb dbname ?>__create_contact');
  78. INSERT INTO menu_acl (node_id, acl_type, role_name)
  79. values (30, 'allow', 'lsmb_<?lsmb dbname ?>__create_contact');
  80. INSERT INTO menu_acl (node_id, acl_type, role_name)
  81. values (31, 'allow', 'lsmb_<?lsmb dbname ?>__create_contact');
  82. CREATE ROLE lsmb_<?lsmb dbname ?>__edit_contact
  83. WITH INHERIT NOLOGIN
  84. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  85. GRANT UPDATE ON entity TO lsmb_<?lsmb dbname ?>__create_contact;
  86. GRANT UPDATE ON company TO lsmb_<?lsmb dbname ?>__create_contact;
  87. GRANT UPDATE ON location TO lsmb_<?lsmb dbname ?>__create_contact;
  88. GRANT UPDATE ON person TO lsmb_<?lsmb dbname ?>__create_contact;
  89. GRANT UPDATE ON entity_credit_account TO lsmb_<?lsmb dbname ?>__create_contact;
  90. GRANT UPDATE ON company_to_contact TO lsmb_<?lsmb dbname ?>__create_contact;
  91. GRANT UPDATE ON company_to_entity TO lsmb_<?lsmb dbname ?>__create_contact;
  92. GRANT UPDATE ON company_to_location TO lsmb_<?lsmb dbname ?>__create_contact;
  93. GRANT UPDATE ON customertax TO lsmb_<?lsmb dbname ?>__create_contact;
  94. GRANT UPDATE ON employee TO lsmb_<?lsmb dbname ?>__create_contact;
  95. GRANT UPDATE ON customer TO lsmb_<?lsmb dbname ?>__create_contact;
  96. GRANT UPDATE ON entity_bank_account TO lsmb_<?lsmb dbname ?>__create_contact;
  97. GRANT UPDATE ON entity_note TO lsmb_<?lsmb dbname ?>__create_contact;
  98. GRANT UPDATE ON entity_class_to_entity TO lsmb_<?lsmb dbname ?>__create_contact;
  99. GRANT UPDATE ON entity_other_name TO lsmb_<?lsmb dbname ?>__create_contact;
  100. GRANT UPDATE ON person_to_company TO lsmb_<?lsmb dbname ?>__create_contact;
  101. GRANT UPDATE ON person_to_contact TO lsmb_<?lsmb dbname ?>__create_contact;
  102. GRANT UPDATE ON person_to_contact TO lsmb_<?lsmb dbname ?>__create_contact;
  103. GRANT UPDATE ON person_to_location TO lsmb_<?lsmb dbname ?>__create_contact;
  104. GRANT UPDATE ON person_to_location TO lsmb_<?lsmb dbname ?>__create_contact;
  105. GRANT DELETE, INSERT ON vendortax TO lsmb_<?lsmb dbname ?>__create_contact;
  106. CREATE ROLE lsmb_<?lsmb dbname ?>__contact_all_rights
  107. WITH INHERIT NOLOGIN
  108. in role lsmb_<?lsmb dbname ?>__create_contact,
  109. lsmb_<?lsmb dbname ?>__edit_contact,
  110. lsmb_<?lsmb dbname ?>__read_contact;
  111. -- Batches and VOuchers
  112. CREATE ROLE lsmb_<?lsmb dbname ?>__create_batch
  113. WITH INHERIT NOLOGIN;
  114. GRANT INSERT ON batch TO lsmb_<?lsmb dbname ?>__create_batch;
  115. GRANT ALL ON batch_id_seq TO lsmb_<?lsmb dbname ?>__create_batch;
  116. GRANT SELECT ON batch_class TO lsmb_<?lsmb dbname ?>__create_batch;
  117. GRANT INSERT ON voucher TO lsmb_<?lsmb dbname ?>__create_batch;
  118. GRANT ALL ON voucher_id_seq TO lsmb_<?lsmb dbname ?>__create_contact;
  119. -- TODO add Menu ACLs
  120. CREATE ROLE lsmb_<?lsmb dbname ?>__post_batches
  121. WITH INHERIT NOLOGIN;
  122. GRANT UPDATE ON ar TO lsmb_<?lsmb dbname ?>__post_batches;
  123. GRANT UPDATE ON ap TO lsmb_<?lsmb dbname ?>__post_batches;
  124. GRANT UPDATE ON acc_trans TO lsmb_<?lsmb dbname ?>__post_batches;
  125. GRANT UPDATE ON batch TO lsmb_<?lsmb dbname ?>__post_batches;
  126. GRANT UPDATE ON gl TO lsmb_<?lsmb dbname ?>__post_batches;
  127. -- TODO add Menu ACLs
  128. -- AR
  129. CREATE ROLE lsmb_<?lsmb dbname ?>__create_ar_transaction
  130. WITH INHERIT NOLOGIN
  131. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  132. GRANT INSERT ON ar TO lsmb_<?lsmb dbname ?>__create_ar_transaction;
  133. GRANT ALL ON id TO lsmb_<?lsmb dbname ?>__create_ar_transaction;
  134. GRANT INSERT ON acc_trans TO lsmb_<?lsmb dbname ?>__create_ar_transaction;
  135. GRANT ALL ON acc_trans_entry_id_seq TO lsmb_<?lsmb dbname ?>__create_ar_transaction;
  136. INSERT INTO menu_acl (node_id, acl_type, role_name)
  137. values (1, 'allow', 'lsmb_<?lsmb dbname ?>__create_ar_transaction');
  138. INSERT INTO menu_acl (node_id, acl_type, role_name)
  139. values (2, 'allow', 'lsmb_<?lsmb dbname ?>__create_ar_transaction');
  140. INSERT INTO menu_acl (node_id, acl_type, role_name)
  141. values (194, 'allow', 'lsmb_<?lsmb dbname ?>__create_ar_transaction');
  142. CREATE ROLE lsmb_<?lsmb dbname ?>__create_ar_transaction_voucher
  143. WITH INHERIT NOLOGIN
  144. IN ROLE lsmb_<?lsmb dbname ?>__read_contact,
  145. lsmb_<?lsmb dbname ?>__create_batch;
  146. GRANT INSERT ON ar TO lsmb_<?lsmb dbname ?>__create_ar_transaction_voucher;
  147. GRANT ALL ON id TO lsmb_<?lsmb dbname ?>__create_ar_transaction_voucher;
  148. GRANT INSERT ON acc_trans TO lsmb_<?lsmb dbname ?>__create_ar_transaction_voucher;
  149. GRANT ALL ON acc_trans_entry_id_seq TO lsmb_<?lsmb dbname ?>__create_ar_transaction_voucher;
  150. -- TODO add Menu ACLs
  151. CREATE ROLE lsmb_<?lsmb dbname ?>__create_ar_invoice
  152. WITH INHERIT NOLOGIN
  153. IN ROLE lsmb_<?lsmb dbname ?>__read_contact,
  154. lsmb_<?lsmb dbname ?>__create_ar_transaction;
  155. GRANT INSERT ON invoice TO lsmb_<?lsmb dbname ?>__create_ar_invoice;
  156. GRANT ALL ON invoice_id_seq TO lsmb_<?lsmb dbname ?>__create_ar_invoice;
  157. GRANT INSERT ON inventory TO lsmb_<?lsmb dbname ?>__create_ar_invoice;
  158. GRANT ALL ON inventory_entry_id_seq TO lsmb_<?lsmb dbname ?>__create_ar_invoice;
  159. INSERT INTO menu_acl (node_id, acl_type, role_name)
  160. values (3, 'allow', 'lsmb_<?lsmb dbname ?>__create_ar_invoice');
  161. INSERT INTO menu_acl (node_id, acl_type, role_name)
  162. values (195, 'allow', 'lsmb_<?lsmb dbname ?>__create_ar_transaction');
  163. CREATE ROLE lsmb_<?lsmb dbname ?>__create_ar_invoice_voucher
  164. WITH INHERIT NOLOGIN
  165. IN ROLE lsmb_<?lsmb dbname ?>__read_contact,
  166. lsmb_<?lsmb dbname ?>__create_batch,
  167. lsmb_<?lsmb dbname ?>__create_ar_transaction_voucher;
  168. GRANT INSERT ON invoice TO lsmb_<?lsmb dbname ?>__create_ar_invoice_voucher;
  169. GRANT ALL ON invoice_id_seq TO lsmb_<?lsmb dbname ?>__create_ar_invoice_voucher;
  170. GRANT INSERT ON inventory TO lsmb_<?lsmb dbname ?>__create_ar_invoice_voucher;
  171. GRANT ALL ON inventory_entry_id_seq TO lsmb_<?lsmb dbname ?>__create_ar_invoice_voucher;
  172. -- TODO add Menu ACLs
  173. CREATE ROLE lsmb_<?lsmb dbname ?>__list_ar_transactions
  174. WITH INHERIT NOLOGIN
  175. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  176. GRANT SELECT ON ar TO lsmb_<?lsmb dbname ?>__list_ar_transactions;
  177. GRANT SELECT ON acc_trans TO lsmb_<?lsmb dbname ?>__list_ar_transactions;
  178. GRANT SELECT ON invoice TO lsmb_<?lsmb dbname ?>__list_ar_transactions
  179. GRANT SELECT ON inventory TO lsmb_<?lsmb dbname ?>__list_ar_transactions
  180. INSERT INTO menu_acl (node_id, acl_type, role_name)
  181. values (1, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
  182. INSERT INTO menu_acl (node_id, acl_type, role_name)
  183. values (4, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
  184. INSERT INTO menu_acl (node_id, acl_type, role_name)
  185. values (5, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
  186. INSERT INTO menu_acl (node_id, acl_type, role_name)
  187. values (6, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
  188. INSERT INTO menu_acl (node_id, acl_type, role_name)
  189. values (7, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
  190. INSERT INTO menu_acl (node_id, acl_type, role_name)
  191. values (9, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
  192. INSERT INTO menu_acl (node_id, acl_type, role_name)
  193. values (10, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
  194. INSERT INTO menu_acl (node_id, acl_type, role_name)
  195. values (11, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
  196. INSERT INTO menu_acl (node_id, acl_type, role_name)
  197. values (13, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
  198. INSERT INTO menu_acl (node_id, acl_type, role_name)
  199. values (15, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
  200. CREATE ROLE lsmb_<?lsmb dbname ?>__ar_all_vouchers
  201. WITH INHERIT NOLOGIN
  202. IN ROLE lsmb_<?lsmb dbname ?>__create_ar_transaction_voucher,
  203. lsmb_<?lsmb dbname ?>__create_ar_invoice_voucher;
  204. CREATE ROLE lsmb_<?lsmb dbname ?>__ar_all_transactions
  205. WITH INHERIT NOLOGIN
  206. IN ROLE lsmb_<?lsmb dbname ?>__create_ar_transaction,
  207. lsmb_<?lsmb dbname ?>__create_ar_invoice,
  208. lsmb_<?lsmb dbname ?>__list_ar_transactions;
  209. CREATE ROLE lsmb_<?lsmb dbname ?>__create_sales_order
  210. WITH INHERIT NOLOGIN
  211. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  212. GRANT INSERT ON oe TO lsmb_<?lsmb dbname ?>__create_sales_order;
  213. GRANT ALL ON oe_id_seq TO lsmb_<?lsmb dbname ?>__create_sales_order;
  214. GRANT INSERT ON orderitems TO lsmb_<?lsmb dbname ?>__create_sales_order;
  215. GRANT ALL ON orderitems_id_seq TO lsmb_<?lsmb dbname ?>__create_sales_order;
  216. INSERT INTO menu_acl (node_id, acl_type, role_name)
  217. values (50, 'allow', 'lsmb_<?lsmb dbname ?>__create_sales_order');
  218. INSERT INTO menu_acl (node_id, acl_type, role_name)
  219. values (51, 'allow', 'lsmb_<?lsmb dbname ?>__create_sales_order');
  220. CREATE ROLE lsmb_<?lsmb dbname ?>__create_sales_quotation
  221. WITH INHERIT NOLOGIN
  222. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  223. GRANT INSERT ON oe TO lsmb_<?lsmb dbname ?>__create_sales_quotation;
  224. GRANT ALL ON oe_id_seq TO lsmb_<?lsmb dbname ?>__create_sales_quotation;
  225. GRANT INSERT ON orderitems TO lsmb_<?lsmb dbname ?>__create_sales_quotation;
  226. GRANT ALL ON orderitems_id_seq TO lsmb_<?lsmb dbname ?>__create_sales_quotation;
  227. INSERT INTO menu_acl (node_id, acl_type, role_name)
  228. values (67, 'allow', 'lsmb_<?lsmb dbname ?>__create_sales_quotation');
  229. INSERT INTO menu_acl (node_id, acl_type, role_name)
  230. values (68, 'allow', 'lsmb_<?lsmb dbname ?>__create_sales_quotation');
  231. CREATE ROLE lsmb_<?lsmb dbname ?>__list_sales_orders
  232. WITH INHERIT NOLOGIN
  233. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  234. GRANT SELECT ON oe TO lsmb_<?lsmb dbname ?>__list_sales_orders;
  235. GRANT SELECT ON orderitems TO lsmb_<?lsmb dbname ?>__list_sales_orders;
  236. INSERT INTO menu_acl (node_id, acl_type, role_name)
  237. values (50, 'allow', 'lsmb_<?lsmb dbname ?>__list_sales_orders');
  238. INSERT INTO menu_acl (node_id, acl_type, role_name)
  239. values (53, 'allow', 'lsmb_<?lsmb dbname ?>__list_sales_orders');
  240. INSERT INTO menu_acl (node_id, acl_type, role_name)
  241. values (54, 'allow', 'lsmb_<?lsmb dbname ?>__list_sales_orders');
  242. CREATE ROLE lsmb_<?lsmb dbname ?>__list_sales_quotations
  243. WITH INHERIT NOLOGIN
  244. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  245. GRANT SELECT ON oe TO lsmb_<?lsmb dbname ?>__list_sales_quotations;
  246. GRANT SELECT ON orderitems TO lsmb_<?lsmb dbname ?>__list_sales_quotations;
  247. INSERT INTO menu_acl (node_id, acl_type, role_name)
  248. values (67, 'allow', 'lsmb_<?lsmb dbname ?>__list_sales_quotations');
  249. INSERT INTO menu_acl (node_id, acl_type, role_name)
  250. values (70, 'allow', 'lsmb_<?lsmb dbname ?>__list_sales_quotations');
  251. INSERT INTO menu_acl (node_id, acl_type, role_name)
  252. values (71, 'allow', 'lsmb_<?lsmb dbname ?>__list_sales_quotations');
  253. CREATE ROLE lsmb_<?lsmb dbname ?>__all_ar
  254. WITH INHERIT NOLOGIN
  255. IN ROLE lsmb_<?lsmb dbname ?>__ar_all_vouchers,
  256. lsmb_<?lsmb dbname ?>__ar_all_transactions,
  257. lsmb_<?lsmb dbname ?>__create_sales_order,
  258. lsmb_<?lsmb dbname ?>__create_sales_quotation,
  259. lsmb_<?lsmb dbname ?>__list_sales_orders,
  260. lsmb_<?lsmb dbname ?>__list_sales_quotations;
  261. -- AP
  262. CREATE ROLE lsmb_<?lsmb dbname ?>__create_ap_transaction
  263. WITH INHERIT NOLOGIN
  264. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  265. GRANT INSERT ON ap TO lsmb_<?lsmb dbname ?>__create_ap_transaction;
  266. GRANT ALL ON id TO lsmb_<?lsmb dbname ?>__create_ap_transaction;
  267. GRANT INSERT ON acc_trans TO lsmb_<?lsmb dbname ?>__create_ap_transaction;
  268. GRANT ALL ON acc_trans_entry_id TO lsmb_<?lsmb dbname ?>__create_ap_transaction;
  269. INSERT INTO menu_acl (node_id, acl_type, role_name)
  270. values (21, 'allow', 'lsmb_<?lsmb dbname ?>__create_ap_transaction');
  271. INSERT INTO menu_acl (node_id, acl_type, role_name)
  272. values (22, 'allow', 'lsmb_<?lsmb dbname ?>__create_ap_transaction');
  273. INSERT INTO menu_acl (node_id, acl_type, role_name)
  274. values (196, 'allow', 'lsmb_<?lsmb dbname ?>__create_ap_transaction');
  275. CREATE ROLE lsmb_<?lsmb dbname ?>__create_ap_transaction_voucher
  276. WITH INHERIT NOLOGIN
  277. IN ROLE lsmb_<?lsmb dbname ?>__read_contact,
  278. lsmb_<?lsmb dbname ?>__create_batch;
  279. GRANT INSERT ON ar TO lsmb_<?lsmb dbname ?>__create_ap_transaction_voucher;
  280. GRANT ALL ON id TO lsmb_<?lsmb dbname ?>__create_ap_transaction_voucher;
  281. GRANT INSERT ON acc_trans TO lsmb_<?lsmb dbname ?>__create_ap_transaction_voucher;
  282. GRANT ALL ON acc_trans_entry_id TO lsmb_<?lsmb dbname ?>__create_ap_transaction_voucher;
  283. -- TODO add Menu ACLs
  284. CREATE ROLE lsmb_<?lsmb dbname ?>__create_ap_invoice
  285. WITH INHERIT NOLOGIN
  286. IN ROLE lsmb_<?lsmb dbname ?>__read_contact,
  287. lsmb_<?lsmb dbname ?>__create_ap_transaction;
  288. GRANT INSERT ON invoice TO lsmb_<?lsmb dbname ?>__create_ap_invoice;
  289. GRANT INSERT ON inventory TO lsmb_<?lsmb dbname ?>__create_ap_invoice;
  290. GRANT ALL ON invoice_id_seq TO lsmb_<?lsmb dbname ?>__create_ap_invoice;
  291. GRANT ALL ON inventory_entry_id_seq TO lsmb_<?lsmb dbname ?>__create_ap_invoice;
  292. INSERT INTO menu_acl (node_id, acl_type, role_name)
  293. values (23, 'allow', 'lsmb_<?lsmb dbname ?>__create_ap_invoice');
  294. INSERT INTO menu_acl (node_id, acl_type, role_name)
  295. values (197, 'allow', 'lsmb_<?lsmb dbname ?>__create_ap_transaction');
  296. CREATE ROLE lsmb_<?lsmb dbname ?>__create_ap_invoice_voucher
  297. WITH INHERIT NOLOGIN
  298. IN ROLE lsmb_<?lsmb dbname ?>__read_contact,
  299. lsmb_<?lsmb dbname ?>__create_batch;
  300. GRANT INSERT ON invoice TO lsmb_<?lsmb dbname ?>__create_ap_invoice_voucher;
  301. GRANT INSERT ON inventory TO lsmb_<?lsmb dbname ?>__create_ap_invoice_voucher;
  302. GRANT ALL ON invoice_id_seq TO lsmb_<?lsmb dbname ?>__create_ap_invoice_voucher;
  303. GRANT ALL ON inventory_entry_id_seq TO lsmb_<?lsmb dbname ?>__create_ap_invoice_voucher;
  304. -- TODO add Menu ACLs
  305. CREATE ROLE lsmb_<?lsmb dbname ?>__list_ap_transactions
  306. WITH INHERIT NOLOGIN
  307. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  308. GRANT SELECT ON ap TO lsmb_<?lsmb dbname ?>__list_ap_transactions;
  309. GRANT SELECT ON acc_trans TO lsmb_<?lsmb dbname ?>__list_ap_transactions;
  310. GRANT SELECT ON invoice TO lsmb_<?lsmb dbname ?>__list_ap_transactions
  311. GRANT SELECT ON inventory TO lsmb_<?lsmb dbname ?>__list_ap_transactions
  312. INSERT INTO menu_acl (node_id, acl_type, role_name)
  313. values (21, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
  314. INSERT INTO menu_acl (node_id, acl_type, role_name)
  315. values (24, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
  316. INSERT INTO menu_acl (node_id, acl_type, role_name)
  317. values (25, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
  318. INSERT INTO menu_acl (node_id, acl_type, role_name)
  319. values (26, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
  320. INSERT INTO menu_acl (node_id, acl_type, role_name)
  321. values (27, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
  322. INSERT INTO menu_acl (node_id, acl_type, role_name)
  323. values (28, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
  324. INSERT INTO menu_acl (node_id, acl_type, role_name)
  325. values (29, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
  326. INSERT INTO menu_acl (node_id, acl_type, role_name)
  327. values (30, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
  328. INSERT INTO menu_acl (node_id, acl_type, role_name)
  329. values (32, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
  330. INSERT INTO menu_acl (node_id, acl_type, role_name)
  331. values (34, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
  332. CREATE ROLE lsmb_<?lsmb dbname ?>__ap_all_vouchers
  333. WITH INHERIT NOLOGIN
  334. IN ROLE lsmb_<?lsmb dbname ?>__create_ap_transaction_voucher,
  335. lsmb_<?lsmb dbname ?>__create_ap_invoice_voucher;
  336. CREATE ROLE lsmb_<?lsmb dbname ?>__ap_all_transactions
  337. WITH INHERIT NOLOGIN
  338. IN ROLE lsmb_<?lsmb dbname ?>__create_ap_transaction,
  339. lsmb_<?lsmb dbname ?>__create_ap_invoice,
  340. lsmb_<?lsmb dbname ?>__list_ap_transactions;
  341. CREATE ROLE lsmb_<?lsmb dbname ?>__create_purchase_order
  342. WITH INHERIT NOLOGIN
  343. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  344. WITH INHERIT NOLOGIN;
  345. GRANT INSERT ON oe TO lsmb_<?lsmb dbname ?>__create_purchase_order;
  346. GRANT INSERT ON orderitems TO lsmb_<?lsmb dbname ?>__create_purchase_order;
  347. GRANT ALL ON oe_id_seq TO lsmb_<?lsmb dbname ?>__create_purchase_order;
  348. GRANT ALL ON orderitems_id_seq TO lsmb_<?lsmb dbname ?>__create_purchase_order;
  349. INSERT INTO menu_acl (node_id, acl_type, role_name)
  350. values (50, 'allow', 'lsmb_<?lsmb dbname ?>__create_purchase_order');
  351. INSERT INTO menu_acl (node_id, acl_type, role_name)
  352. values (52, 'allow', 'lsmb_<?lsmb dbname ?>__create_purchase_order');
  353. CREATE ROLE lsmb_<?lsmb dbname ?>__create_purchase_rfq
  354. WITH INHERIT NOLOGIN
  355. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  356. GRANT INSERT ON oe TO lsmb_<?lsmb dbname ?>__create_purchase_rfq;
  357. GRANT INSERT ON orderitems TO lsmb_<?lsmb dbname ?>__create_purchase_rfq;
  358. GRANT ALL ON oe_id_seq TO lsmb_<?lsmb dbname ?>__create_purchase_rfq;
  359. GRANT ALL ON orderitems_id_seq TO lsmb_<?lsmb dbname ?>__create_purchase_rfq;
  360. INSERT INTO menu_acl (node_id, acl_type, role_name)
  361. values (67, 'allow', 'lsmb_<?lsmb dbname ?>__create_purchase_rfq');
  362. INSERT INTO menu_acl (node_id, acl_type, role_name)
  363. values (69, 'allow', 'lsmb_<?lsmb dbname ?>__create_purchase_rfq');
  364. CREATE ROLE lsmb_<?lsmb dbname ?>__list_purchase_orders
  365. WITH INHERIT NOLOGIN
  366. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  367. GRANT SELECT ON oe TO lsmb_<?lsmb dbname ?>__list_purchase_orders;
  368. GRANT SELECT ON orderitems TO lsmb_<?lsmb dbname ?>__list_purchase_orders;
  369. INSERT INTO menu_acl (node_id, acl_type, role_name)
  370. values (50, 'allow', 'lsmb_<?lsmb dbname ?>__list_purchase_orders');
  371. INSERT INTO menu_acl (node_id, acl_type, role_name)
  372. values (53, 'allow', 'lsmb_<?lsmb dbname ?>__list_purchase_orders');
  373. INSERT INTO menu_acl (node_id, acl_type, role_name)
  374. values (55, 'allow', 'lsmb_<?lsmb dbname ?>__list_purchase_orders');
  375. CREATE ROLE lsmb_<?lsmb dbname ?>__list_purchase_rfqs
  376. WITH INHERIT NOLOGIN
  377. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  378. GRANT SELECT ON oe TO lsmb_<?lsmb dbname ?>__list_purchase_rfqs;
  379. GRANT SELECT ON orderitems TO lsmb_<?lsmb dbname ?>__list_purchase_rfqs;
  380. INSERT INTO menu_acl (node_id, acl_type, role_name)
  381. values (67, 'allow', 'lsmb_<?lsmb dbname ?>__list_purchase_rfqs');
  382. INSERT INTO menu_acl (node_id, acl_type, role_name)
  383. values (70, 'allow', 'lsmb_<?lsmb dbname ?>__list_purchase_rfqs');
  384. INSERT INTO menu_acl (node_id, acl_type, role_name)
  385. values (72, 'allow', 'lsmb_<?lsmb dbname ?>__list_purchase_rfqs');
  386. CREATE ROLE lsmb_<?lsmb dbname ?>__all_ap
  387. WITH INHERIT NOLOGIN
  388. IN ROLE lsmb_<?lsmb dbname ?>__ap_all_vouchers,
  389. lsmb_<?lsmb dbname ?>__ap_all_transactions,
  390. lsmb_<?lsmb dbname ?>__create_purchase_order,
  391. lsmb_<?lsmb dbname ?>__create_purchase_rfq,
  392. lsmb_<?lsmb dbname ?>__list_purchase_orders,
  393. lsmb_<?lsmb dbname ?>__list_purchase_rfqs;
  394. -- POS
  395. CREATE ROLE lsmb_<?lsmb dbname ?>__create_pos_invoice
  396. WITH INHERIT NOLOGIN
  397. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  398. GRANT INSERT ON invoice TO lsmb_<?lsmb dbname ?>__create_pos_invoice;
  399. GRANT INSERT ON inventory TO lsmb_<?lsmb dbname ?>__create_pos_invoice;
  400. GRANT INSERT ON ar TO lsmb_<?lsmb dbname ?>__create_pos_invoice;
  401. GRANT INSERT ON acc_trans TO lsmb_<?lsmb dbname ?>__create_pos_invoice;
  402. GRANT ALL ON id TO lsmb_<?lsmb dbname ?>__create_pos_invoice;
  403. GRANT ALL ON acc_trans_entry_id_seq TO lsmb_<?lsmb dbname ?>__create_pos_invoice;
  404. GRANT ALL ON invoice_id_seq TO lsmb_<?lsmb dbname ?>__create_pos_invoice;
  405. GRANT ALL ON inventory_entry_id_seq TO lsmb_<?lsmb dbname ?>__create_pos_invoice;
  406. INSERT INTO menu_acl (node_id, acl_type, role_name)
  407. values (16, 'allow', 'lsmb_<?lsmb dbname ?>__create_pos_invoice');
  408. INSERT INTO menu_acl (node_id, acl_type, role_name)
  409. values (17, 'allow', 'lsmb_<?lsmb dbname ?>__create_pos_invoice');
  410. INSERT INTO menu_acl (node_id, acl_type, role_name)
  411. values (18, 'allow', 'lsmb_<?lsmb dbname ?>__create_pos_invoice');
  412. CREATE ROLE lsmb_<?lsmb dbname ?>__close_till
  413. WITH INHERIT NOLOGIN;
  414. GRANT INSERT ON gl TO lsmb_<?lsmb dbname ?>__close_till;
  415. GRANT INSERT ON acc_trans TO lsmb_<?lsmb dbname ?>__close_till;
  416. GRANT ALL ON id TO lsmb_<?lsmb dbname ?>__close_till;
  417. GRANT ALL ON acc_trans_entry_id_seq TO lsmb_<?lsmb dbname ?>__close_till;
  418. INSERT INTO menu_acl (node_id, acl_type, role_name)
  419. values (16, 'allow', 'lsmb_<?lsmb dbname ?>__close_till');
  420. INSERT INTO menu_acl (node_id, acl_type, role_name)
  421. values (19, 'allow', 'lsmb_<?lsmb dbname ?>__close_till');
  422. CREATE ROLE lsmb_<?lsmb dbname ?>__list_all_open
  423. WITH INHERIT NOLOGIN;
  424. GRANT SELECT ON ar TO lsmb_<?lsmb dbname ?>__list_all_open;
  425. GRANT SELECT ON acc_trans TO lsmb_<?lsmb dbname ?>__list_all_open;
  426. INSERT INTO menu_acl (node_id, acl_type, role_name)
  427. values (16, 'allow', 'lsmb_<?lsmb dbname ?>__list_all_open');
  428. INSERT INTO menu_acl (node_id, acl_type, role_name)
  429. values (18, 'allow', 'lsmb_<?lsmb dbname ?>__list_all_open');
  430. CREATE ROLE lsmb_<?lsmb dbname ?>__pos_cashier
  431. WITH INHERIT NOLOGIN
  432. lsmb_<?lsmb dbname ?>__create_pos_invoice,
  433. lsmb_<?lsmb dbname ?>__close_till;
  434. CREATE ROLE lsmb_<?lsmb dbname ?>__all_pos
  435. WITH INHERIT NOLOGIN
  436. IN ROLE lsmb_<?lsmb dbname ?>__pos_cashier,
  437. lsmb_<?lsmb dbname ?>__list_all_open;
  438. -- CASH
  439. CREATE ROLE lsmb_<?lsmb dbname ?>__reconcile
  440. WITH INHERIT NOLOGIN;
  441. GRANT INSERT ON pending_reports TO lsmb_<?lsmb dbname ?>__reconcile;
  442. GRANT INSERT on report_corrections TO lsmb_<?lsmb dbname ?>__reconcile;
  443. GRANT SELECT ON acc_trans TO lsmb_<?lsmb dbname ?>__reconcile;
  444. GRANT ALL ON pending_reports_id_seq TO lsmb_<?lsmb dbname ?>__reconcile;
  445. GRANT ALL ON report_corrections_id_seq TO lsmb_<?lsmb dbname ?>__reconcile;
  446. INSERT INTO menu_acl (node_id, acl_type, role_name)
  447. values (35, 'allow', 'lsmb_<?lsmb dbname ?>_reconcile');
  448. INSERT INTO menu_acl (node_id, acl_type, role_name)
  449. values (45, 'allow', 'lsmb_<?lsmb dbname ?>_reconcile');
  450. CREATE ROLE lsmb_<?lsmb dbname ?>__approve_reconciliation
  451. WITH INHERIT NOLOGIN;
  452. GRANT UPDATE ON pending_reports TO lsmb_<?lsmb dbname ?>__reconcile;
  453. GRANT SELECT ON acc_trans TO lsmb_<?lsmb dbname ?>__reconcile;
  454. INSERT INTO menu_acl (node_id, acl_type, role_name)
  455. values (35, 'allow', 'lsmb_<?lsmb dbname ?>_reconcile');
  456. INSERT INTO menu_acl (node_id, acl_type, role_name)
  457. values (41, 'allow', 'lsmb_<?lsmb dbname ?>_reconcile');
  458. INSERT INTO menu_acl (node_id, acl_type, role_name)
  459. values (44, 'allow', 'lsmb_<?lsmb dbname ?>_reconcile');
  460. CREATE ROLE lsmb_<?lsmb dbname ?>__all_reconcile
  461. WITH INHERIT NOLOGIN
  462. IN ROLE lsmb_<?lsmb dbname ?>__reconcile,
  463. lsmb_<?lsmb dbname ?>__approve_reconciliation;
  464. CREATE ROLE lsmb_<?lsmb dbname ?>__process_payment
  465. WITH INHERIT NOLOGIN
  466. IN ROLE ap_list_transactions;
  467. GRANT INSERT ON acc_trans TO lsmb_<?lsmb dbname ?>__process_payment;
  468. GRANT ALL ON acc_trans_entry_id_seq TO lsmb_<?lsmb dbname ?>__process_payment;
  469. INSERT INTO menu_acl (node_id, acl_type, role_name)
  470. values (35, 'allow', 'lsmb_<?lsmb dbname ?>__process_payment');
  471. INSERT INTO menu_acl (node_id, acl_type, role_name)
  472. values (38, 'allow', 'lsmb_<?lsmb dbname ?>__process_payment');
  473. INSERT INTO menu_acl (node_id, acl_type, role_name)
  474. values (39, 'allow', 'lsmb_<?lsmb dbname ?>__process_payment');
  475. CREATE ROLE lsmb_<?lsmb dbname ?>__process_receipt
  476. WITH INHERIT NOLOGIN
  477. IN ROLE ar_list_transactions;
  478. GRANT INSERT ON acc_trans TO lsmb_<?lsmb dbname ?>__process_receipt;
  479. GRANT ALL ON acc_trans_entry_id_seq TO lsmb_<?lsmb dbname ?>__process_receipt;
  480. INSERT INTO menu_acl (node_id, acl_type, role_name)
  481. values (35, 'allow', 'lsmb_<?lsmb dbname ?>__process_receipt');
  482. INSERT INTO menu_acl (node_id, acl_type, role_name)
  483. values (36, 'allow', 'lsmb_<?lsmb dbname ?>__process_receipt');
  484. INSERT INTO menu_acl (node_id, acl_type, role_name)
  485. values (47, 'allow', 'lsmb_<?lsmb dbname ?>__process_receipt');
  486. CREATE ROLE lsmb_<?lsmb dbname ?>__cash_all
  487. WITH INHERIT NOLOGIN
  488. IN ROLE lsmb_<?lsmb dbname ?>__all_reconcile,
  489. lsmb_<?lsmb dbname ?>__process_payment,
  490. lsmb_<?lsmb dbname ?>__process_receipt;
  491. -- Inventory Control
  492. CREATE ROLE lsmb_<?lsmb dbname ?>__create_part
  493. WITH INHERIT NOLOGIN;
  494. GRANT INSERT ON parts TO lsmb_<?lsmb dbname ?>__create_part;
  495. GRANT ALL ON parts_id_seq TO lsmb_<?lsmb dbname ?>__create_part;
  496. INSERT INTO menu_acl (node_id, acl_type, role_name)
  497. values (77, 'allow', 'lsmb_<?lsmb dbname ?>__create_part');
  498. INSERT INTO menu_acl (node_id, acl_type, role_name)
  499. values (78, 'allow', 'lsmb_<?lsmb dbname ?>__create_part');
  500. INSERT INTO menu_acl (node_id, acl_type, role_name)
  501. values (79, 'allow', 'lsmb_<?lsmb dbname ?>__create_part');
  502. INSERT INTO menu_acl (node_id, acl_type, role_name)
  503. values (80, 'allow', 'lsmb_<?lsmb dbname ?>__create_part');
  504. INSERT INTO menu_acl (node_id, acl_type, role_name)
  505. values (81, 'allow', 'lsmb_<?lsmb dbname ?>__create_part');
  506. INSERT INTO menu_acl (node_id, acl_type, role_name)
  507. values (82, 'allow', 'lsmb_<?lsmb dbname ?>__create_part');
  508. CREATE ROLE lsmb_<?lsmb dbname ?>__edit_part
  509. WITH INHERIT NOLOGIN;
  510. GRANT UPDATE ON parts TO lsmb_<?lsmb dbname ?>__edit_part;
  511. INSERT INTO menu_acl (node_id, acl_type, role_name)
  512. values (77, 'allow', 'lsmb_<?lsmb dbname ?>__edit_part');
  513. INSERT INTO menu_acl (node_id, acl_type, role_name)
  514. values (85, 'allow', 'lsmb_<?lsmb dbname ?>__edit_part');
  515. INSERT INTO menu_acl (node_id, acl_type, role_name)
  516. values (86, 'allow', 'lsmb_<?lsmb dbname ?>__edit_part');
  517. INSERT INTO menu_acl (node_id, acl_type, role_name)
  518. values (87, 'allow', 'lsmb_<?lsmb dbname ?>__edit_part');
  519. INSERT INTO menu_acl (node_id, acl_type, role_name)
  520. values (88, 'allow', 'lsmb_<?lsmb dbname ?>__edit_part');
  521. INSERT INTO menu_acl (node_id, acl_type, role_name)
  522. values (89, 'allow', 'lsmb_<?lsmb dbname ?>__edit_part');
  523. INSERT INTO menu_acl (node_id, acl_type, role_name)
  524. values (90, 'allow', 'lsmb_<?lsmb dbname ?>__edit_part');
  525. INSERT INTO menu_acl (node_id, acl_type, role_name)
  526. values (91, 'allow', 'lsmb_<?lsmb dbname ?>__edit_part');
  527. INSERT INTO menu_acl (node_id, acl_type, role_name)
  528. values (93, 'allow', 'lsmb_<?lsmb dbname ?>__edit_part');
  529. CREATE ROLE lsmb_<?lsmb dbname ?>__inventory_reports
  530. WITH INHERIT NOLOGIN;
  531. GRANT SELECT ON ar TO lsmb_<?lsmb dbname ?>__inventory_reports;
  532. GRANT SELECT ON ap TO lsmb_<?lsmb dbname ?>__inventory_reports;
  533. GRANT SELECT ON inventory TO lsmb_<?lsmb dbname ?>__inventory_reports;
  534. GRANT SELECT ON invoice TO lsmb_<?lsmb dbname ?>__inventory_reports;
  535. GRANT SELECT ON acc_trans TO lsmb_<?lsmb dbname ?>__inventory_reports;
  536. INSERT INTO menu_acl (node_id, acl_type, role_name)
  537. values (77, 'allow', 'lsmb_<?lsmb dbname ?>__inventory_reports');
  538. INSERT INTO menu_acl (node_id, acl_type, role_name)
  539. values (85, 'allow', 'lsmb_<?lsmb dbname ?>__inventory_reports');
  540. INSERT INTO menu_acl (node_id, acl_type, role_name)
  541. values (88, 'allow', 'lsmb_<?lsmb dbname ?>__inventory_reports');
  542. INSERT INTO menu_acl (node_id, acl_type, role_name)
  543. values (94, 'allow', 'lsmb_<?lsmb dbname ?>__inventory_reports');
  544. CREATE ROLE lsmb_<?lsmb dbname ?>__create_pricegroup
  545. WITH INHERIT NOLOGIN
  546. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  547. GRANT INSERT ON pricegroup TO lsmb_<?lsmb dbname ?>__create_pricegroup;
  548. GRANT ALL ON pricegroup_id_seq TO lsmb_<?lsmb dbname ?>__create_pricegroup;
  549. GRANT UPDATE ON entity_credit_account TO lsmb_<?lsmb dbname ?>__create_pricegroup;
  550. INSERT INTO menu_acl (node_id, acl_type, role_name)
  551. values (77, 'allow', 'lsmb_<?lsmb dbname ?>__create_pricegroup');
  552. INSERT INTO menu_acl (node_id, acl_type, role_name)
  553. values (83, 'allow', 'lsmb_<?lsmb dbname ?>__create_pricegroup');
  554. CREATE ROLE lsmb_<?lsmb dbname ?>__edit_pricegroup
  555. WITH INHERIT NOLOGIN
  556. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  557. GRANT UPDATE ON pricegroup TO lsmb_<?lsmb dbname ?>__edit_pricegroup;
  558. GRANT UPDATE ON entity_credit_account TO lsmb_<?lsmb dbname ?>__edit_pricegroup;
  559. INSERT INTO menu_acl (node_id, acl_type, role_name)
  560. values (77, 'allow', 'lsmb_<?lsmb dbname ?>__edit_pricegroup');
  561. INSERT INTO menu_acl (node_id, acl_type, role_name)
  562. values (85, 'allow', 'lsmb_<?lsmb dbname ?>__edit_pricegroup');
  563. INSERT INTO menu_acl (node_id, acl_type, role_name)
  564. values (92, 'allow', 'lsmb_<?lsmb dbname ?>__edit_pricegroup');
  565. CREATE ROLE lsmb_<?lsmb dbname ?>__stock_assembly
  566. WITH INHERIT NOLOGIN;
  567. GRANT UPDATE ON parts TO lsmb_<?lsmb dbname ?>__stock_assembly;
  568. INSERT INTO menu_acl (node_id, acl_type, role_name)
  569. values (77, 'allow', 'lsmb_<?lsmb dbname ?>__stock_assembly');
  570. INSERT INTO menu_acl (node_id, acl_type, role_name)
  571. values (84, 'allow', 'lsmb_<?lsmb dbname ?>__stock_assembly');
  572. CREATE ROLE lsmb_<?lsmb dbname ?>__ship_inventory
  573. WITH INHERIT NOLOGIN
  574. IN ROLE lsmb_<?lsmb dbname ?>__list_sales_orders;
  575. GRANT INSERT ON inventory TO lsmb_<?lsmb dbname ?>__ship_inventory;
  576. GRANT ALL ON inventory_entry_id_seq TO lsmb_<?lsmb dbname ?>__ship_inventory;
  577. INSERT INTO menu_acl (node_id, acl_type, role_name)
  578. values (63, 'allow', 'lsmb_<?lsmb dbname ?>__ship_inventory');
  579. INSERT INTO menu_acl (node_id, acl_type, role_name)
  580. values (64, 'allow', 'lsmb_<?lsmb dbname ?>__ship_inventory');
  581. CREATE ROLE lsmb_<?lsmb dbname ?>__receive_inventory
  582. WITH INHERIT NOLOGIN
  583. IN ROLE lsmb_<?lsmb dbname ?>__list_purchase_orders;
  584. GRANT INSERT ON inventory TO lsmb_<?lsmb dbname ?>__receive_inventory;
  585. GRANT ALL ON inventory_entry_id_seq TO lsmb_<?lsmb dbname ?>__receive_inventory;
  586. INSERT INTO menu_acl (node_id, acl_type, role_name)
  587. values (63, 'allow', 'lsmb_<?lsmb dbname ?>__receive_inventory');
  588. INSERT INTO menu_acl (node_id, acl_type, role_name)
  589. values (65, 'allow', 'lsmb_<?lsmb dbname ?>__receive_inventory');
  590. CREATE ROLE lsmb_<?lsmb dbname ?>__transfer_inventory
  591. WITH INHERIT NOLOGIN;
  592. GRANT INSERT ON inventory TO lsmb_<?lsmb dbname ?>__transfer_inventory;
  593. GRANT ALL ON inventory_entry_id_seq TO lsmb_<?lsmb dbname ?>__transfer_inventory;
  594. INSERT INTO menu_acl (node_id, acl_type, role_name)
  595. values (63, 'allow', 'lsmb_<?lsmb dbname ?>__transfer_inventory');
  596. INSERT INTO menu_acl (node_id, acl_type, role_name)
  597. values (66, 'allow', 'lsmb_<?lsmb dbname ?>__transfer_inventory');
  598. CREATE ROLE lsmb_<?lsmb dbname ?>__create_warehouse
  599. WITH INHERIT NOLOGIN;
  600. GRANT INSERT ON warehouse TO lsmb_<?lsmb dbname ?>__create_warehouse;
  601. GRANT ALL ON warehouse_id_seq TO lsmb_<?lsmb dbname ?>__create_warehouse;
  602. INSERT INTO menu_acl (node_id, acl_type, role_name)
  603. values (128, 'allow', 'lsmb_<?lsmb dbname ?>__create_warehouse');
  604. INSERT INTO menu_acl (node_id, acl_type, role_name)
  605. values (141, 'allow', 'lsmb_<?lsmb dbname ?>__create_warehouse');
  606. INSERT INTO menu_acl (node_id, acl_type, role_name)
  607. values (142, 'allow', 'lsmb_<?lsmb dbname ?>__create_warehouse');
  608. CREATE ROLE lsmb_<?lsmb dbname ?>__edit_warehouse
  609. WITH INHERIT NOLOGIN;
  610. GRANT UPDATE ON warehouse TO lsmb_<?lsmb dbname ?>__edit_warehouse;
  611. INSERT INTO menu_acl (node_id, acl_type, role_name)
  612. values (128, 'allow', 'lsmb_<?lsmb dbname ?>__edit_warehouse');
  613. INSERT INTO menu_acl (node_id, acl_type, role_name)
  614. values (141, 'allow', 'lsmb_<?lsmb dbname ?>__edit_warehouse');
  615. INSERT INTO menu_acl (node_id, acl_type, role_name)
  616. values (143, 'allow', 'lsmb_<?lsmb dbname ?>__edit_warehouse');
  617. CREATE ROLE lsmb_<?lsmb dbname ?>__all_inventory
  618. WITH INHERIT NOLOGIN
  619. IN ROLE lsmb_<?lsmb dbname ?>__create_part,
  620. lsmb_<?lsmb dbname ?>__inventory_reports,
  621. lsmb_<?lsmb dbname ?>__stock_assembly,
  622. lsmb_<?lsmb dbname ?>__ship_inventory,
  623. lsmb_<?lsmb dbname ?>__receive_inventory,
  624. lsmb_<?lsmb dbname ?>__transfer_inventory,
  625. lsmb_<?lsmb dbname ?>__edit_warehouse,
  626. lsmb_<?lsmb dbname ?>__create_warehouse;
  627. -- GL
  628. CREATE ROLE lsmb_<?lsmb dbname ?>__create_transaction
  629. WITH INHERIT NOLOGIN;
  630. GRANT INSERT ON gl TO lsmb_<?lsmb dbname ?>__create_transaction;
  631. GRANT INSERT ON acc_trans TO lsmb_<?lsmb dbname ?>__create_transaction;
  632. GRANT ALL ON id TO lsmb_<?lsmb dbname ?>__create_transaction;
  633. GRANT ALL ON acc_trans_entry_id TO lsmb_<?lsmb dbname ?>__create_transaction;
  634. INSERT INTO menu_acl (node_id, acl_type, role_name)
  635. values (73, 'allow', 'lsmb_<?lsmb dbname ?>__create_transaction');
  636. INSERT INTO menu_acl (node_id, acl_type, role_name)
  637. values (74, 'allow', 'lsmb_<?lsmb dbname ?>__create_transaction');
  638. INSERT INTO menu_acl (node_id, acl_type, role_name)
  639. values (75, 'allow', 'lsmb_<?lsmb dbname ?>__create_transaction');
  640. INSERT INTO menu_acl (node_id, acl_type, role_name)
  641. values (35, 'allow', 'lsmb_<?lsmb dbname ?>__create_transaction');
  642. INSERT INTO menu_acl (node_id, acl_type, role_name)
  643. values (40, 'allow', 'lsmb_<?lsmb dbname ?>__create_transaction');
  644. CREATE ROLE lsmb_<?lsmb dbname ?>__create_transaction_voucher
  645. WITH INHERIT NOLOGIN;
  646. GRANT INSERT ON gl TO lsmb_<?lsmb dbname ?>__create_transaction_voucher;
  647. GRANT INSERT ON acc_trans TO lsmb_<?lsmb dbname ?>__create_transaction_voucher;
  648. GRANT ALL ON id TO lsmb_<?lsmb dbname ?>__create_transaction_voucher;
  649. GRANT ALL ON acc_trans_entry_id TO lsmb_<?lsmb dbname ?>__create_transaction_voucher;
  650. -- TODO Add menu permissions
  651. CREATE ROLE lsmb_<?lsmb dbname ?>__list_transactions
  652. WITH INHERIT NOLOGIN
  653. IN ROLE lsmb_<?lsmb dbname ?>__list_ar_transactions,
  654. lsmb_<?lsmb dbname ?>__list_ap_transactions;
  655. GRANT SELECT ON gl TO lsmb_<?lsmb dbname ?>__list_transactions;
  656. INSERT INTO menu_acl (node_id, acl_type, role_name)
  657. values (73, 'allow', 'lsmb_<?lsmb dbname ?>__list_transactions');
  658. INSERT INTO menu_acl (node_id, acl_type, role_name)
  659. values (76, 'allow', 'lsmb_<?lsmb dbname ?>__list_transactions');
  660. CREATE ROLE lsmb_<?lsmb dbname ?>__run_yearend
  661. WITH INHERIT NOLOGIN;
  662. GRANT INSERT, SELECT ON acc_trans TO lsmb_<?lsmb dbname ?>__run_yearend;
  663. INSERT INTO menu_acl (node_id, acl_type, role_name)
  664. values (128, 'allow', 'lsmb_<?lsmb dbname ?>__run_yearend');
  665. INSERT INTO menu_acl (node_id, acl_type, role_name)
  666. values (132, 'allow', 'lsmb_<?lsmb dbname ?>__run_yearend');
  667. CREATE ROLE lsmb_<?lsmb dbname ?>__list_batches
  668. WITH INHERIT NOLOGIN
  669. IN ROLE lsmb_<?lsmb dbname ?>__list_transactions;
  670. GRANT SELECT ON batch TO lsmb_<?lsmb dbname ?>__list_batches;
  671. GRANT SELECT ON batch_class TO lsmb_<?lsmb dbname ?>__list_batches;
  672. GRANT SELECT ON voucher TO lsmb_<?lsmb dbname ?>__list_batches;
  673. -- TODO: Add menu items
  674. CREATE ROLE lsmb_<?lsmb dbname ?>__all_gl
  675. WITH INHERIT NOLOGIN
  676. IN ROLE lsmb_<?lsmb dbname ?>__create_transaction,
  677. lsmb_<?lsmb dbname ?>__create_transaction_voucher,
  678. lsmb_<?lsmb dbname ?>__run_yearend,
  679. lsmb_<?lsmb dbname ?>__list_transactions;
  680. -- PROJECTS
  681. CREATE ROLE lsmb_<?lsmb dbname ?>__create_project
  682. WITH INHERIT NOLOGIN;
  683. GRANT INSERT ON project TO lsmb_<?lsmb dbname ?>__create_project;
  684. GRANT ALL ON project_id_seq TO lsmb_<?lsmb dbname ?>__create_project;
  685. INSERT INTO menu_acl (node_id, acl_type, role_name)
  686. values (98, 'allow', 'lsmb_<?lsmb dbname ?>__create_project');
  687. INSERT INTO menu_acl (node_id, acl_type, role_name)
  688. values (99, 'allow', 'lsmb_<?lsmb dbname ?>__create_project');
  689. CREATE ROLE lsmb_<?lsmb dbname ?>__edit_project
  690. WITH INHERIT NOLOGIN;
  691. GRANT UPDATE ON project TO lsmb_<?lsmb dbname ?>__edit_project;
  692. INSERT INTO menu_acl (node_id, acl_type, role_name)
  693. values (98, 'allow', 'lsmb_<?lsmb dbname ?>__edit_project');
  694. INSERT INTO menu_acl (node_id, acl_type, role_name)
  695. values (103, 'allow', 'lsmb_<?lsmb dbname ?>__edit_project');
  696. INSERT INTO menu_acl (node_id, acl_type, role_name)
  697. values (104, 'allow', 'lsmb_<?lsmb dbname ?>__edit_project');
  698. CREATE ROLE lsmb_<?lsmb dbname ?>__add_project_timecard
  699. WITH INHERIT NOLOGIN
  700. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  701. GRANT INSERT ON jcitems TO lsmb_<?lsmb dbname ?>__add_project_timecard;
  702. GRANT ALL ON jcitems_id_seq TO lsmb_<?lsmb dbname ?>__add_project_timecard;
  703. INSERT INTO menu_acl (node_id, acl_type, role_name)
  704. values (98, 'allow', 'lsmb_<?lsmb dbname ?>__add_project_timecard');
  705. INSERT INTO menu_acl (node_id, acl_type, role_name)
  706. values (100, 'allow', 'lsmb_<?lsmb dbname ?>__add_project_timecard');
  707. INSERT INTO menu_acl (node_id, acl_type, role_name)
  708. values (103, 'allow', 'lsmb_<?lsmb dbname ?>__add_project_timecard');
  709. INSERT INTO menu_acl (node_id, acl_type, role_name)
  710. values (106, 'allow', 'lsmb_<?lsmb dbname ?>__add_project_timecard');
  711. CREATE ROLE lsmb_<?lsmb dbname ?>__list_project_timecards
  712. WITH INHERIT NOLOGIN
  713. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  714. GRANT UPDATE ON project TO lsmb_<?lsmb dbname ?>__edit_project;
  715. INSERT INTO menu_acl (node_id, acl_type, role_name)
  716. values (98, 'allow', 'lsmb_<?lsmb dbname ?>__edit_project');
  717. INSERT INTO menu_acl (node_id, acl_type, role_name)
  718. values (103, 'allow', 'lsmb_<?lsmb dbname ?>__edit_project');
  719. INSERT INTO menu_acl (node_id, acl_type, role_name)
  720. values (106, 'allow', 'lsmb_<?lsmb dbname ?>__edit_project');
  721. -- ORDER GENERATION
  722. CREATE ROLE lsmb_<?lsmb dbname ?>__generate_orders
  723. WITH INHERIT NOLOGIN
  724. IN ROLE lsmb_<?lsmb dbname ?>__read_contact;
  725. GRANT SELECT, INSERT, UPDATE ON oe TO lsmb_<?lsmb dbname ?>__generate_orders;
  726. GRANT SELECT, INSERT, UPDATE ON orderitems TO lsmb_<?lsmb dbname ?>__generate_orders;
  727. GRANT ALL ON oe_id_seq TO lsmb_<?lsmb dbname ?>__generate_orders;
  728. GRANT ALL ON orderitems_id_seq TO lsmb_<?lsmb dbname ?>__generate_orders;
  729. CREATE ROLE lsmb_<?lsmb dbname ?>__project_generate_orders
  730. WITH INHERIT NOLOGIN
  731. IN ROLE lsmb_<?lsmb dbname ?>__generate_orders;
  732. INSERT INTO menu_acl (node_id, acl_type, role_name)
  733. values (98, 'allow', 'lsmb_<?lsmb dbname ?>__project_generate_orders');
  734. INSERT INTO menu_acl (node_id, acl_type, role_name)
  735. values (101, 'allow', 'lsmb_<?lsmb dbname ?>__project_generate_orders');
  736. INSERT INTO menu_acl (node_id, acl_type, role_name)
  737. values (102, 'allow', 'lsmb_<?lsmb dbname ?>__project_generate_orders');
  738. CREATE ROLE lsmb_<?lsmb dbname ?>__sales_to_purchase_orders
  739. WITH INHERIT NOLOGIN
  740. IN ROLE lsmb_<?lsmb dbname ?>__generate_orders;
  741. INSERT INTO menu_acl (node_id, acl_type, role_name)
  742. values (50, 'allow', 'lsmb_<?lsmb dbname ?>__sales_to_purchase_orders');
  743. INSERT INTO menu_acl (node_id, acl_type, role_name)
  744. values (56, 'allow', 'lsmb_<?lsmb dbname ?>__sales_to_purchase_orders');
  745. INSERT INTO menu_acl (node_id, acl_type, role_name)
  746. values (57, 'allow', 'lsmb_<?lsmb dbname ?>__sales_to_purchase_orders');
  747. INSERT INTO menu_acl (node_id, acl_type, role_name)
  748. values (58, 'allow', 'lsmb_<?lsmb dbname ?>__sales_to_purchase_orders');
  749. CREATE ROLE lsmb_<?lsmb dbname ?>__consolidate_purchase_orders
  750. WITH INHERIT NOLOGIN
  751. IN ROLE lsmb_<?lsmb dbname ?>__generate_orders;
  752. INSERT INTO menu_acl (node_id, acl_type, role_name)
  753. values (50, 'allow', 'lsmb_<?lsmb dbname ?>__consolidate_purchase_orders');
  754. INSERT INTO menu_acl (node_id, acl_type, role_name)
  755. values (60, 'allow', 'lsmb_<?lsmb dbname ?>__consolidate_purchase_orders');
  756. INSERT INTO menu_acl (node_id, acl_type, role_name)
  757. values (62, 'allow', 'lsmb_<?lsmb dbname ?>__consolidate_purchase_orders');
  758. CREATE ROLE lsmb_<?lsmb dbname ?>__consolidate_sales_orders
  759. WITH INHERIT NOLOGIN
  760. IN ROLE lsmb_<?lsmb dbname ?>__generate_orders;
  761. INSERT INTO menu_acl (node_id, acl_type, role_name)
  762. values (50, 'allow', 'lsmb_<?lsmb dbname ?>__consolidate_sales_orders');
  763. INSERT INTO menu_acl (node_id, acl_type, role_name)
  764. values (60, 'allow', 'lsmb_<?lsmb dbname ?>__consolidate_sales_orders');
  765. INSERT INTO menu_acl (node_id, acl_type, role_name)
  766. values (61, 'allow', 'lsmb_<?lsmb dbname ?>__consolidate_sales_orders');
  767. CREATE ROLE lsmb_<?lsmb dbname ?>__manage_orders
  768. WITH INHERIT NOLOGIN
  769. IN ROLE lsmb_<?lsmb dbname ?>__project_generate_orders,
  770. lsmb_<?lsmb dbname ?>__sales_to_purchase_orders,
  771. lsmb_<?lsmb dbname ?>__consolidate_purchase_orders,
  772. lsmb_<?lsmb dbname ?>__consolidate_sales_orders;
  773. -- FINANCIAL REPORTS
  774. CREATE ROLE lsmb_<?lsmb dbname ?>__run_financial_reports
  775. WITH INHERIT NOLOGIN
  776. IN ROLE lsmb_<?lsmb dbname ?>__list_transactions;
  777. INSERT INTO menu_acl (node_id, acl_type, role_name)
  778. values (109, 'allow', 'lsmb_<?lsmb dbname ?>__run_financial_reports');
  779. INSERT INTO menu_acl (node_id, acl_type, role_name)
  780. values (110, 'allow', 'lsmb_<?lsmb dbname ?>__run_financial_reports');
  781. INSERT INTO menu_acl (node_id, acl_type, role_name)
  782. values (111, 'allow', 'lsmb_<?lsmb dbname ?>__run_financial_reports');
  783. INSERT INTO menu_acl (node_id, acl_type, role_name)
  784. values (112, 'allow', 'lsmb_<?lsmb dbname ?>__run_financial_reports');
  785. INSERT INTO menu_acl (node_id, acl_type, role_name)
  786. values (113, 'allow', 'lsmb_<?lsmb dbname ?>__run_financial_reports');
  787. -- RECURRING TRANSACTIONS
  788. -- TO ADD WHEN THIS IS REDESIGNED
  789. -- BATCH PRINTING
  790. CREATE ROLE lsmb_<?lsmb dbname ?>__list_print_jobs
  791. WITH INHERIT NOLOGIN;
  792. INSERT INTO menu_acl (node_id, acl_type, role_name)
  793. values (116, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
  794. INSERT INTO menu_acl (node_id, acl_type, role_name)
  795. values (117, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
  796. INSERT INTO menu_acl (node_id, acl_type, role_name)
  797. values (118, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
  798. INSERT INTO menu_acl (node_id, acl_type, role_name)
  799. values (119, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
  800. INSERT INTO menu_acl (node_id, acl_type, role_name)
  801. values (120, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
  802. INSERT INTO menu_acl (node_id, acl_type, role_name)
  803. values (121, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
  804. INSERT INTO menu_acl (node_id, acl_type, role_name)
  805. values (122, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
  806. INSERT INTO menu_acl (node_id, acl_type, role_name)
  807. values (123, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
  808. INSERT INTO menu_acl (node_id, acl_type, role_name)
  809. values (124, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
  810. INSERT INTO menu_acl (node_id, acl_type, role_name)
  811. values (125, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
  812. INSERT INTO menu_acl (node_id, acl_type, role_name)
  813. values (126, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
  814. INSERT INTO menu_acl (node_id, acl_type, role_name)
  815. values (127, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
  816. CREATE ROLE lsmb_<?lsmb dbname ?>__print_jobs
  817. WITH INHERIT NOLOGIN
  818. IN ROLE lsmb_<?lsmb dbname ?>__list_print_jobs;
  819. -- SYSTEM SETTINGS
  820. CREATE ROLE lsmb_<?lsmb dbname ?>__list_system_settings
  821. WITH INHERIT NOLOGIN;
  822. INSERT INTO menu_acl (node_id, acl_type, role_name)
  823. values (128, 'allow', 'lsmb_<?lsmb dbname ?>__list_system_settings');
  824. INSERT INTO menu_acl (node_id, acl_type, role_name)
  825. values (129, 'allow', 'lsmb_<?lsmb dbname ?>__list_system_settings');
  826. INSERT INTO menu_acl (node_id, acl_type, role_name)
  827. values (131, 'allow', 'lsmb_<?lsmb dbname ?>__list_system_settings');
  828. CREATE ROLE lsmb_<?lsmb dbname ?>__change_system_settings
  829. WITH INHERIT NOLOGIN
  830. IN ROLE lsmb_<?lsmb dbname ?>__list_system_settings;
  831. CREATE ROLE lsmb_<?lsmb dbname ?>__set_taxes
  832. WITH INHERIT NOLOGIN;
  833. GRANT INSERT, UPDATE ON tax TO lsmb_<?lsmb dbname ?>__set_taxes;
  834. INSERT INTO menu_acl (node_id, acl_type, role_name)
  835. values (128, 'allow', 'lsmb_<?lsmb dbname ?>__set_taxes');
  836. INSERT INTO menu_acl (node_id, acl_type, role_name)
  837. values (130, 'allow', 'lsmb_<?lsmb dbname ?>__set_taxes');
  838. CREATE ROLE lsmb_<?lsmb dbname ?>__create_account
  839. WITH INHERIT NOLOGIN;
  840. GRANT INSERT ON chart TO lsmb_<?lsmb dbname ?>__create_account;
  841. GRANT ALL ON chart_id_seq TO lsmb_<?lsmb dbname ?>__create_account;
  842. INSERT INTO menu_acl (node_id, acl_type, role_name)
  843. values (128, 'allow', 'lsmb_<?lsmb dbname ?>__create_account');
  844. INSERT INTO menu_acl (node_id, acl_type, role_name)
  845. values (136, 'allow', 'lsmb_<?lsmb dbname ?>__create_account');
  846. INSERT INTO menu_acl (node_id, acl_type, role_name)
  847. values (137, 'allow', 'lsmb_<?lsmb dbname ?>__create_account');
  848. CREATE ROLE lsmb_<?lsmb dbname ?>__edit_account
  849. WITH INHERIT NOLOGIN;
  850. GRANT UPDATE ON chart TO lsmb_<?lsmb dbname ?>__edit_account;
  851. INSERT INTO menu_acl (node_id, acl_type, role_name)
  852. values (128, 'allow', 'lsmb_<?lsmb dbname ?>__edit_account');
  853. INSERT INTO menu_acl (node_id, acl_type, role_name)
  854. values (136, 'allow', 'lsmb_<?lsmb dbname ?>__edit_account');
  855. INSERT INTO menu_acl (node_id, acl_type, role_name)
  856. values (138, 'allow', 'lsmb_<?lsmb dbname ?>__edit_account');
  857. CREATE ROLE lsmb_<?lsmb dbname ?>__create_gifi
  858. WITH INHERIT NOLOGIN;
  859. GRANT INSERT ON gifi TO lsmb_<?lsmb dbname ?>__create_gifi;
  860. INSERT INTO menu_acl (node_id, acl_type, role_name)
  861. values (128, 'allow', 'lsmb_<?lsmb dbname ?>__create_gifi');
  862. INSERT INTO menu_acl (node_id, acl_type, role_name)
  863. values (136, 'allow', 'lsmb_<?lsmb dbname ?>__create_gifi');
  864. INSERT INTO menu_acl (node_id, acl_type, role_name)
  865. values (139, 'allow', 'lsmb_<?lsmb dbname ?>__create_gifi');
  866. CREATE ROLE lsmb_<?lsmb dbname ?>__edit_gifi
  867. WITH INHERIT NOLOGIN;
  868. GRANT UPDATE ON gifi TO lsmb_<?lsmb dbname ?>__edit_gifi;
  869. INSERT INTO menu_acl (node_id, acl_type, role_name)
  870. values (128, 'allow', 'lsmb_<?lsmb dbname ?>__edit_account');
  871. INSERT INTO menu_acl (node_id, acl_type, role_name)
  872. values (136, 'allow', 'lsmb_<?lsmb dbname ?>__edit_account');
  873. INSERT INTO menu_acl (node_id, acl_type, role_name)
  874. values (140, 'allow', 'lsmb_<?lsmb dbname ?>__edit_account');
  875. CREATE ROLE lsmb_<?lsmb dbname ?>__all_accounts
  876. WITH INHERIT NOLOGIN
  877. IN ROLE lsmb_<?lsmb dbname ?>__create_account,
  878. lsmb_<?lsmb dbname ?>__set_taxes,
  879. lsmb_<?lsmb dbname ?>__edit_account,
  880. lsmb_<?lsmb dbname ?>__create_gifi;
  881. lsmb_<?lsmb dbname ?>__edit_gifi;
  882. CREATE ROLE lsmb_<?lsmb dbname ?>__create_department
  883. WITH INHERIT NOLOGIN;
  884. GRANT INSERT ON department TO lsmb_<?lsmb dbname ?>__create_department;
  885. GRANT ALL ON department_id_seq TO lsmb_<?lsmb dbname ?>__create_department;
  886. INSERT INTO menu_acl (node_id, acl_type, role_name)
  887. values (128, 'allow', 'lsmb_<?lsmb dbname ?>__create_department');
  888. INSERT INTO menu_acl (node_id, acl_type, role_name)
  889. values (144, 'allow', 'lsmb_<?lsmb dbname ?>__create_department');
  890. INSERT INTO menu_acl (node_id, acl_type, role_name)
  891. values (145, 'allow', 'lsmb_<?lsmb dbname ?>__create_department');
  892. CREATE ROLE lsmb_<?lsmb dbname ?>__edit_department
  893. WITH INHERIT NOLOGIN;
  894. GRANT UPDATE ON department TO lsmb_<?lsmb dbname ?>__edit_department;
  895. INSERT INTO menu_acl (node_id, acl_type, role_name)
  896. values (128, 'allow', 'lsmb_<?lsmb dbname ?>__edit_department');
  897. INSERT INTO menu_acl (node_id, acl_type, role_name)
  898. values (144, 'allow', 'lsmb_<?lsmb dbname ?>__edit_department');
  899. INSERT INTO menu_acl (node_id, acl_type, role_name)
  900. values (146, 'allow', 'lsmb_<?lsmb dbname ?>__edit_department');
  901. CREATE ROLE lsmb_<?lsmb dbname ?>__all_department
  902. WITH INHERIT NOLOGIN
  903. IN ROLE lsmb_<?lsmb dbname ?>__create_department,
  904. lsmb_<?lsmb dbname ?>__edit_department;
  905. CREATE ROLE lsmb_<?lsmb dbname ?>__create_business_type
  906. WITH INHERIT NOLOGIN;
  907. GRANT INSERT ON business TO lsmb_<?lsmb dbname ?>__create_business_type;
  908. GRANT ALL ON business_id_seq TO lsmb_<?lsmb dbname ?>__create_business_type;
  909. INSERT INTO menu_acl (node_id, acl_type, role_name)
  910. values (128, 'allow', 'lsmb_<?lsmb dbname ?>__create_business_type');
  911. INSERT INTO menu_acl (node_id, acl_type, role_name)
  912. values (147, 'allow', 'lsmb_<?lsmb dbname ?>__create_business_type');
  913. INSERT INTO menu_acl (node_id, acl_type, role_name)
  914. values (148, 'allow', 'lsmb_<?lsmb dbname ?>__create_business_type');
  915. CREATE ROLE lsmb_<?lsmb dbname ?>__edit_business_type
  916. WITH INHERIT NOLOGIN;
  917. GRANT UPDATE ON business TO lsmb_<?lsmb dbname ?>__edit_business_type;
  918. INSERT INTO menu_acl (node_id, acl_type, role_name)
  919. values (128, 'allow', 'lsmb_<?lsmb dbname ?>__edit_business_type');
  920. INSERT INTO menu_acl (node_id, acl_type, role_name)
  921. values (147, 'allow', 'lsmb_<?lsmb dbname ?>__edit_business_type');
  922. INSERT INTO menu_acl (node_id, acl_type, role_name)
  923. values (149, 'allow', 'lsmb_<?lsmb dbname ?>__edit_business_type');
  924. CREATE ROLE lsmb_<?lsmb dbname ?>__all_business_type
  925. WITH INHERIT NOLOGIN
  926. IN ROLE lsmb_<?lsmb dbname ?>__create_business_type,
  927. lsmb_<?lsmb dbname ?>__edit_business_type;
  928. CREATE ROLE lsmb_<?lsmb dbname ?>__create_sic
  929. WITH INHERIT NOLOGIN;
  930. GRANT INSERT ON sic TO lsmb_<?lsmb dbname ?>__create_sic;
  931. INSERT INTO menu_acl (node_id, acl_type, role_name)
  932. values (128, 'allow', 'lsmb_<?lsmb dbname ?>__create_sic');
  933. INSERT INTO menu_acl (node_id, acl_type, role_name)
  934. values (153, 'allow', 'lsmb_<?lsmb dbname ?>__create_sic');
  935. INSERT INTO menu_acl (node_id, acl_type, role_name)
  936. values (154, 'allow', 'lsmb_<?lsmb dbname ?>__create_sic');
  937. CREATE ROLE lsmb_<?lsmb dbname ?>__edit_sic
  938. WITH INHERIT NOLOGIN;
  939. GRANT UPDATE ON sic TO lsmb_<?lsmb dbname ?>__edit_sic;
  940. INSERT INTO menu_acl (node_id, acl_type, role_name)
  941. values (128, 'allow', 'lsmb_<?lsmb dbname ?>__edit_sic');
  942. INSERT INTO menu_acl (node_id, acl_type, role_name)
  943. values (153, 'allow', 'lsmb_<?lsmb dbname ?>__edit_sic');
  944. INSERT INTO menu_acl (node_id, acl_type, role_name)
  945. values (155, 'allow', 'lsmb_<?lsmb dbname ?>__edit_sic');
  946. CREATE ROLE lsmb_<?lsmb dbname ?>__all_sic
  947. WITH INHERIT NOLOGIN
  948. IN ROLE lsmb_<?lsmb dbname ?>__create_sic,
  949. lsmb_<?lsmb dbname ?>__edit_sic;
  950. CREATE ROLE lsmb_<?lsmb dbname ?>__edit_template
  951. WITH INHERIT NOLOGIN;
  952. -- TODO Add db permissions as templates get moved into db.
  953. INSERT INTO menu_acl (node_id, acl_type, role_name)
  954. values (128, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  955. INSERT INTO menu_acl (node_id, acl_type, role_name)
  956. values (156, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  957. INSERT INTO menu_acl (node_id, acl_type, role_name)
  958. values (157, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  959. INSERT INTO menu_acl (node_id, acl_type, role_name)
  960. values (158, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  961. INSERT INTO menu_acl (node_id, acl_type, role_name)
  962. values (159, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  963. INSERT INTO menu_acl (node_id, acl_type, role_name)
  964. values (160, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  965. INSERT INTO menu_acl (node_id, acl_type, role_name)
  966. values (161, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  967. INSERT INTO menu_acl (node_id, acl_type, role_name)
  968. values (162, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  969. INSERT INTO menu_acl (node_id, acl_type, role_name)
  970. values (163, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  971. INSERT INTO menu_acl (node_id, acl_type, role_name)
  972. values (164, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  973. INSERT INTO menu_acl (node_id, acl_type, role_name)
  974. values (165, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  975. INSERT INTO menu_acl (node_id, acl_type, role_name)
  976. values (166, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  977. INSERT INTO menu_acl (node_id, acl_type, role_name)
  978. values (167, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  979. INSERT INTO menu_acl (node_id, acl_type, role_name)
  980. values (168, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  981. INSERT INTO menu_acl (node_id, acl_type, role_name)
  982. values (169, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  983. INSERT INTO menu_acl (node_id, acl_type, role_name)
  984. values (170, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  985. INSERT INTO menu_acl (node_id, acl_type, role_name)
  986. values (171, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  987. INSERT INTO menu_acl (node_id, acl_type, role_name)
  988. values (172, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  989. INSERT INTO menu_acl (node_id, acl_type, role_name)
  990. values (173, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  991. INSERT INTO menu_acl (node_id, acl_type, role_name)
  992. values (174, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  993. INSERT INTO menu_acl (node_id, acl_type, role_name)
  994. values (175, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  995. INSERT INTO menu_acl (node_id, acl_type, role_name)
  996. values (176, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  997. INSERT INTO menu_acl (node_id, acl_type, role_name)
  998. values (177, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  999. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1000. values (178, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  1001. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1002. values (179, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  1003. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1004. values (180, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  1005. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1006. values (181, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  1007. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1008. values (182, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  1009. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1010. values (183, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  1011. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1012. values (184, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  1013. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1014. values (185, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  1015. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1016. values (186, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  1017. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1018. values (187, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  1019. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1020. values (188, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  1021. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1022. values (189, 'allow', 'lsmb_<?lsmb dbname ?>__edit_template');
  1023. CREATE ROLE lsmb_<?lsmb dbname ?>__manage_system
  1024. WITH INHERIT NOLOGIN
  1025. IN ROLE lsmb_<?lsmb dbname ?>__change_system_settings,
  1026. lsmb_<?lsmb dbname ?>__all_accounts,
  1027. lsmb_<?lsmb dbname ?>__all_department,
  1028. lsmb_<?lsmb dbname ?>__all_business_type,
  1029. lsmb_<?lsmb dbname ?>__all_sic,
  1030. lsmb_<?lsmb dbname ?>__edit_template;
  1031. -- Manual Translation
  1032. CREATE ROLE lsmb_<?lsmb dbname ?>__create_language
  1033. WITH INHERIT NOLOGIN;
  1034. GRANT INSERT ON language TO lsmb_<?lsmb dbname ?>__create_language;
  1035. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1036. values (128, 'allow', 'lsmb_<?lsmb dbname ?>__create_language');
  1037. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1038. values (150, 'allow', 'lsmb_<?lsmb dbname ?>__create_language');
  1039. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1040. values (151, 'allow', 'lsmb_<?lsmb dbname ?>__create_language');
  1041. CREATE ROLE lsmb_<?lsmb dbname ?>__edit_language
  1042. WITH INHERIT NOLOGIN;
  1043. GRANT UPDATE ON language TO lsmb_<?lsmb dbname ?>__edit_language;
  1044. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1045. values (128, 'allow', 'lsmb_<?lsmb dbname ?>__edit_language');
  1046. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1047. values (150, 'allow', 'lsmb_<?lsmb dbname ?>__edit_language');
  1048. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1049. values (152, 'allow', 'lsmb_<?lsmb dbname ?>__edit_language');
  1050. CREATE ROLE lsmb_<?lsmb dbname ?>__create_part_translation
  1051. WITH INHERIT NOLOGIN;
  1052. -- TODO add db permissions
  1053. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1054. values (77, 'allow', 'lsmb_<?lsmb dbname ?>__create_part_translation');
  1055. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1056. values (95, 'allow', 'lsmb_<?lsmb dbname ?>__create_part_translation');
  1057. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1058. values (96, 'allow', 'lsmb_<?lsmb dbname ?>__create_part_translation');
  1059. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1060. values (97, 'allow', 'lsmb_<?lsmb dbname ?>__create_part_translation');
  1061. CREATE ROLE lsmb_<?lsmb dbname ?>__create_project_translation
  1062. WITH INHERIT NOLOGIN;
  1063. -- TODO add db permissions
  1064. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1065. values (98, 'allow', 'lsmb_<?lsmb dbname ?>__create_project_translation');
  1066. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1067. values (107, 'allow', 'lsmb_<?lsmb dbname ?>__create_project_translation');
  1068. INSERT INTO menu_acl (node_id, acl_type, role_name)
  1069. values (108, 'allow', 'lsmb_<?lsmb dbname ?>__create_project_translation');
  1070. CREATE ROLE lsmb_<?lsmb dbname ?>__all_manual_translation
  1071. WITH INHERIT NOLOGIN
  1072. IN ROLE lsmb_<?lsmb dbname ?>__create_language,
  1073. lsmb_<?lsmb dbname ?>__create_part_translation,
  1074. lsmb_<?lsmb dbname ?>__create_project_translation;
  1075. GRANT SELECT ON custom_field_catalog TO public;
  1076. GRANT SELECT ON custom_table_catalog TO public;