5e61ae4f6c67997c9d0d90bdec80a6c70948e1db
[kivitendo-erp.git] / sql / Pg-upgrade2-auth / add_master_rights.sql
1 -- @tag: add_master_rights
2 -- @description: Rechte in die Datenbank migrieren
3 -- @depends: release_3_2_0
4 -- @locales: Master Data
5 -- @locales: Create customers and vendors. Edit all vendors. Edit only customers where salesman equals employee (login)
6 -- @locales: Create customers and vendors. Edit all vendors. Edit all customers
7 -- @locales: Create and edit parts, services, assemblies
8 -- @locales: Show details and reports of parts, services, assemblies
9 -- @locales: Create and edit projects
10 -- @locales: AR
11 -- @locales: Create and edit requirement specs
12 -- @locales: Create and edit sales quotations
13 -- @locales: Create and edit sales orders
14 -- @locales: Create and edit sales delivery orders
15 -- @locales: Create and edit invoices and credit notes
16 -- @locales: Create and edit dunnings
17 -- @locales: Edit sales letters
18 -- @locales: View/edit all employees sales documents
19 -- @locales: Edit prices and discount (if not used, textfield is ONLY set readonly)
20 -- @locales: Show AR transactions as part of AR invoice report
21 -- @locales: Show delivery plan
22 -- @locales: Show delivery value report
23 -- @locales: Show sales letters report
24 -- @locales: AP
25 -- @locales: Create and edit RFQs
26 -- @locales: Create and edit purchase orders
27 -- @locales: Create and edit purchase delivery orders
28 -- @locales: Create and edit vendor invoices
29 -- @locales: Show AP transactions as part of AP invoice report
30 -- @locales: Warehouse management
31 -- @locales: View warehouse content
32 -- @locales: Warehouse management
33 -- @locales: General ledger and cash
34 -- @locales: Transactions, AR transactions, AP transactions
35 -- @locales: DATEV Export
36 -- @locales: Receipt, payment, reconciliation
37 -- @locales: Bank transactions
38 -- @locales: Reports
39 -- @locales: All reports
40 -- @locales: Advance turnover tax return
41 -- @locales: Batch Printing
42 -- @locales: Batch Printing
43 -- @locales: Configuration
44 -- @locales: Change kivitendo installation settings (most entries in the 'System' menu)
45 -- @locales: Client administration: configuration, editing templates, task server control, background jobs (remaining entries in the 'System' menu)
46 -- @locales: Others
47 -- @locales: May set the BCC field when sending emails
48 -- @locales: Productivity
49 -- @locales: Show administration link
50
51 CREATE TABLE auth.master_rights (
52   id          SERIAL PRIMARY KEY,
53   position    INTEGER NOT NULL,
54   name        TEXT NOT NULL UNIQUE,
55   description TEXT NOT NULL,
56   category    BOOLEAN NOT NULL DEFAULT FALSE
57 );
58
59
60 INSERT INTO auth.master_rights (position, name, description, category) VALUES ( 1, 'master_data',                    'Master Data', TRUE);
61 INSERT INTO auth.master_rights (position, name, description) VALUES ( 2, 'customer_vendor_edit',           'Create customers and vendors. Edit all vendors. Edit only customers where salesman equals employee (login)');
62 INSERT INTO auth.master_rights (position, name, description) VALUES ( 3, 'customer_vendor_all_edit',       'Create customers and vendors. Edit all vendors. Edit all customers');
63 INSERT INTO auth.master_rights (position, name, description) VALUES ( 4, 'part_service_assembly_edit',     'Create and edit parts, services, assemblies');
64 INSERT INTO auth.master_rights (position, name, description) VALUES ( 5, 'part_service_assembly_details',  'Show details and reports of parts, services, assemblies');
65 INSERT INTO auth.master_rights (position, name, description) VALUES ( 6, 'project_edit',                   'Create and edit projects');
66 INSERT INTO auth.master_rights (position, name, description, category) VALUES ( 7, 'ar',                             'AR', TRUE);
67 INSERT INTO auth.master_rights (position, name, description) VALUES ( 8, 'requirement_spec_edit',          'Create and edit requirement specs');
68 INSERT INTO auth.master_rights (position, name, description) VALUES ( 9, 'sales_quotation_edit',           'Create and edit sales quotations');
69 INSERT INTO auth.master_rights (position, name, description) VALUES (10, 'sales_order_edit',               'Create and edit sales orders');
70 INSERT INTO auth.master_rights (position, name, description) VALUES (11, 'sales_delivery_order_edit',      'Create and edit sales delivery orders');
71 INSERT INTO auth.master_rights (position, name, description) VALUES (12, 'invoice_edit',                   'Create and edit invoices and credit notes');
72 INSERT INTO auth.master_rights (position, name, description) VALUES (13, 'dunning_edit',                   'Create and edit dunnings');
73 INSERT INTO auth.master_rights (position, name, description) VALUES (14, 'sales_letter_edit',              'Edit sales letters');
74 INSERT INTO auth.master_rights (position, name, description) VALUES (15, 'sales_all_edit',                 'View/edit all employees sales documents');
75 INSERT INTO auth.master_rights (position, name, description) VALUES (16, 'edit_prices',                    'Edit prices and discount (if not used, textfield is ONLY set readonly)');
76 INSERT INTO auth.master_rights (position, name, description) VALUES (17, 'show_ar_transactions',           'Show AR transactions as part of AR invoice report');
77 INSERT INTO auth.master_rights (position, name, description) VALUES (18, 'delivery_plan',                  'Show delivery plan');
78 INSERT INTO auth.master_rights (position, name, description) VALUES (19, 'delivery_value_report',          'Show delivery value report');
79 INSERT INTO auth.master_rights (position, name, description) VALUES (20, 'sales_letter_report',            'Show sales letters report');
80 INSERT INTO auth.master_rights (position, name, description, category) VALUES (21, 'ap',                             'AP', TRUE);
81 INSERT INTO auth.master_rights (position, name, description) VALUES (22, 'request_quotation_edit',         'Create and edit RFQs');
82 INSERT INTO auth.master_rights (position, name, description) VALUES (23, 'purchase_order_edit',            'Create and edit purchase orders');
83 INSERT INTO auth.master_rights (position, name, description) VALUES (24, 'purchase_delivery_order_edit',   'Create and edit purchase delivery orders');
84 INSERT INTO auth.master_rights (position, name, description) VALUES (25, 'vendor_invoice_edit',            'Create and edit vendor invoices');
85 INSERT INTO auth.master_rights (position, name, description) VALUES (26, 'show_ap_transactions',           'Show AP transactions as part of AP invoice report');
86 INSERT INTO auth.master_rights (position, name, description, category) VALUES (27, 'warehouse',                      'Warehouse management', TRUE);
87 INSERT INTO auth.master_rights (position, name, description) VALUES (28, 'warehouse_contents',             'View warehouse content');
88 INSERT INTO auth.master_rights (position, name, description) VALUES (29, 'warehouse_management',           'Warehouse management');
89 INSERT INTO auth.master_rights (position, name, description, category) VALUES (30, 'general_ledger_cash',            'General ledger and cash', TRUE);
90 INSERT INTO auth.master_rights (position, name, description) VALUES (31, 'general_ledger',                 'Transactions, AR transactions, AP transactions');
91 INSERT INTO auth.master_rights (position, name, description) VALUES (32, 'datev_export',                   'DATEV Export');
92 INSERT INTO auth.master_rights (position, name, description) VALUES (33, 'cash',                           'Receipt, payment, reconciliation');
93 INSERT INTO auth.master_rights (position, name, description) VALUES (34, 'bank_transaction',               'Bank transactions');
94 INSERT INTO auth.master_rights (position, name, description, category) VALUES (35, 'reports',                        'Reports', TRUE);
95 INSERT INTO auth.master_rights (position, name, description) VALUES (36, 'report',                         'All reports');
96 INSERT INTO auth.master_rights (position, name, description) VALUES (37, 'advance_turnover_tax_return',    'Advance turnover tax return');
97 INSERT INTO auth.master_rights (position, name, description, category) VALUES (38, 'batch_printing_category',                 'Batch Printing', TRUE);
98 INSERT INTO auth.master_rights (position, name, description) VALUES (39, 'batch_printing',                 'Batch Printing');
99 INSERT INTO auth.master_rights (position, name, description, category) VALUES (40, 'configuration',                  'Configuration', TRUE);
100 INSERT INTO auth.master_rights (position, name, description) VALUES (41, 'config',                         'Change kivitendo installation settings (most entries in the ''System'' menu)');
101 INSERT INTO auth.master_rights (position, name, description) VALUES (42, 'admin',                          'Client administration: configuration, editing templates, task server control, background jobs (remaining entries in the ''System'' menu)');
102 INSERT INTO auth.master_rights (position, name, description, category) VALUES (43, 'others',                         'Others', TRUE);
103 INSERT INTO auth.master_rights (position, name, description) VALUES (44, 'email_bcc',                      'May set the BCC field when sending emails');
104 INSERT INTO auth.master_rights (position, name, description) VALUES (45, 'productivity',                   'Productivity');
105 INSERT INTO auth.master_rights (position, name, description) VALUES (46, 'display_admin_link',             'Show administration link');