5e807ecda9d95b5c3f8ba9a27668c3ba5953a938
[fa-stable.git] / includes / access_levels.inc
1 <?php
2 /**********************************************************************
3     Copyright (C) FrontAccounting, LLC.
4         Released under the terms of the GNU General Public License, GPL, 
5         as published by the Free Software Foundation, either version 3 
6         of the License, or (at your option) any later version.
7     This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
10     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
12 //
13 //      Access areas used in FrontAccounting. 
14 //      Constants defined below should be used wherever access rights for current
15 //      user are checked. Set of allowed access areas is retrieved during login from
16 //      security_roles table using role granted to user as a key, and stored 
17 //      in user profile for use during login session.
18 //      
19 //----------------------------------------------------------------------------------
20 // Sales module
21 //
22 define('SA_CUSTOMER', 101);
23 define('SA_SALESGROUP', 102);
24 define('SA_PRICE', 103);
25 define('SA_SALESMAN', 104);
26 define('SA_SALESAREA', 105);
27 define('SA_STATUS', 106);
28 define('SA_STEMPLATE', 107);
29 define('SA_SRECCURENT', 108);
30
31 define('SA_SALESORDER', 111);
32 define('SA_SALESDELIVERY', 112);
33 define('SA_SALESINVOICE', 113);
34 define('SA_SALESCREDITINV', 114);
35 define('SA_SALESCREDIT', 115);
36 define('SA_SALESPAYMNT', 116);
37
38 define('SA_SALESALLOC', 121);
39 define('SA_SALESANALYTIC', 122);
40 define('SA_SALESMANREP', 123);
41 define('SA_SALESVARREP', 124);
42
43 //
44 // Purchasing module 
45 //
46 define('SA_SUPPLIER', 201);
47
48 define('SA_PURCHASEORDER', 211);
49 define('SA_GRN', 212);
50 define('SA_SUPPLIERINVOICE', 213);
51 define('SA_SUPPLIERCREDIT', 214);
52 define('SA_SUPPLIERPAYMNT', 215);
53
54 define('SA_SUPPLIERALLOC', 221);
55 define('SA_SUPPLIERANALYTIC', 222);
56 define('SA_SUPPLIERMANREP', 223);
57 define('SA_SUPPLIERVARREP', 224);
58
59 //
60 // Inventory module 
61 //
62 define('SA_ITEM', 301);
63 define('SA_FORITEMCODE', 302);
64 define('SA_SALESKIT', 303);
65 define('SA_ITEMCATEGORY', 304);
66 define('SA_INVENTORYLOCATION', 305);
67 define('SA_INVENTORYMOVETYPE', 306);
68 define('SA_ITEMTAXTYPE', 307);
69 define('SA_UOM', 308);
70 define('SA_REORDER', 309);
71
72 define('SA_LOCATIONTRANSFER', 311);
73 define('SA_INVENTORYADJUSTMENT', 312);
74
75 define('SA_ITEMSANALYTIC', 321);
76 define('SA_ITEMSMANREP', 322);
77 define('SA_ITEMSVARREP', 323);
78
79 define('SA_SALESPRICING', 331);
80 define('SA_PURCHASEPRICING', 332);
81 define('SA_STANDARDCOST', 333);
82
83 //
84 // Manufacturing module 
85 //
86 define('SA_BOM', 401);
87 define('SA_WORKCENTRE', 402);
88
89 define('SA_WORKORDERENTRY', 411);
90 define('SA_WORKORDEROPERATION', 412);
91
92 define('SA_WORKORDERANALYTIC', 421);
93 define('SA_WORKORDERMANREP', 422);
94 define('SA_WORKORDERVARREP', 423);
95
96 //
97 // Dimension module 
98 //
99 define('SA_DIMENSION', 501);
100
101 define('SA_DIMENTIONOPERATION', 511);
102
103 define('SA_DIMENSIONANALYTIC', 521);
104 define('SA_DIMENSIONMANREP', 522);
105 define('SA_DIMENSIONVARREP', 523);
106
107 //
108 // Banking and General Ledger module 
109 //
110 define('SA_BANKACCOUNT', 601);
111 define('SA_QUICKENTRY', 602);
112 define('SA_CURRENCY', 603);
113 define('SA_EXCHANGERATE', 604);
114 define('SA_GLACCOUNT', 605);
115 define('SA_GLACCOUNTGROUP', 606);
116 define('SA_GLACCOUNTCLASS', 607);
117
118 define('SA_PAYMENT', 611);
119 define('SA_DEPOSIT', 612);
120 define('SA_BANKACCOUNTTRANSFER', 613);
121 define('SA_JOURNALENTRY', 614);
122 define('SA_BUDGETENTRY', 615);
123 define('SA_RECONCILE', 616);
124
125 define('SA_GLANALYTIC', 621);
126 define('SA_GLMANREP', 622);
127 define('SA_GLVARREP', 623);
128
129 //
130 // Setup module 
131 //
132 define('SA_SETUPCOMPANY', 701);
133 define('SA_SETUPUSER', 702);
134 define('SA_SETUPFORM', 703);
135 define('SA_SETUPTAX', 704);
136 define('SA_SETUPFISCALYEAR', 705);
137 define('SA_PRINTPROFILE', 706);
138 define('SA_PAYMENTTERM', 707);
139 define('SA_SHIPPING', 708);
140 define('SA_SETUPPOS', 709);
141 define('SA_SETUPPRINTER', 710);
142
143 define('SA_VOIDTRANSACTION', 711);
144 define('SA_VIEWPRINTTRANSACTION', 712);
145 define('SA_ATTACHDOCUMENT', 713);
146 define('SA_BACKUP', 714);
147 define('SA_CREATECOMPANY', 715);
148 define('SA_CREATELANGUAGE', 716);
149 define('SA_CREATEMODULES', 717);
150 define('SA_SORTWAREUPGRADE', 718);
151
152 /*
153         This table stores security area ranges. It is used by security_role 
154         table administration interface. Every extension module can add their
155         own security areas set by adding new entries here.
156 */
157 $security_areas = array(
158         // database table crud operations and administrative areas
159         SA_CUSTOMER => _("Sales customer and branches"),
160                 _("Sales groups"),
161                 _("Sales prices"),
162                 _("Sales staff"),
163                 _("Sales areas"),
164                 _("Credit status definitions"),
165                 _("Sales templates"),
166                 _("Recurrent invoices definitions"),
167         // documents, transactions entry
168         SA_SALESORDER => _("Sales order entry"),
169                 _("Sales deliveries"),
170                 _("Sales invoices"),
171                 _("Sales credit notes against invoice"),
172                 _("Sales freehand credit notes"),
173                 _("Customer payments"),
174         // maintenance and analytics
175         SA_SALESALLOC => _("Customer allocations"),
176                 _("Customer analytical reports and inquiries"),
177                 _("Sales reports"),
178                 _("Sales other reports and inquires"),
179         // database table crud operations and administrative areas
180         SA_SUPPLIER => _("Suppliers"),
181         // documents, transactions entry
182         SA_PURCHASEORDER => _("Purchase Order Entry"),
183                 _("Outstanding Purchase Orders"),
184                 _("Supplier Invoices"),
185                 _("Supplier Credit Notes"),
186                 _("Supplier Payments"),
187         // maintenance and analytics
188         SA_SUPPLIERALLOC => _("Supplier allocations"),
189                 _("Supplier analytical reports and inquiries"),
190                 _("Supplier reports"),
191                 _("Supplier other reports and inquiries"),
192         // database table crud operations and administrative areas
193         SA_ITEM => _("Items"),
194                 _("Foreign Item Codes"),
195                 _("Sales Kits"),
196                 _("Item Categories"),
197                 _("Inventory Locations"),
198                 _("Inventory Movement Types"),
199                 _("Item Tax Types"),
200                 _("Unit of Measures"),
201                 _("Reorder Levels"),
202         // documents, transactions entry
203         SA_LOCATIONTRANSFER => _("Inventory Location Transfers"),
204                 _("Inventory Adjustments"),
205         // maintenance and analytics
206         SA_ITEMSANALYTIC => _("Items analytical reports and inquiries"),
207                 _("Inventory reports"),
208                 _("Inventory other reports and inquiries"),
209         SA_SALESPRICING => _("Item Sales Pricing"),
210                 _("Item Purchasing Pricing"),
211                 _("Item Standard Costs"),
212         // database table crud operations and administrative areas
213         SA_BOM => _("Bill of Materials"),
214                 _("Work Centres"),
215         // documents, transactions entry
216         SA_WORKORDERENTRY => _("Work Order Entries"),
217                 _("Work Order Operations"),
218         // maintenance and analytics
219         SA_WORKORDERANALYTIC => _("Work Order analytical reports and inquiries"),
220                 _("Work Order Reports"),
221                 _("Work Order other reports and inquiries"),
222         // database table crud operations and administrative areas
223         SA_DIMENSION => _("Dimensions"),
224         // documents, transactions entry
225         SA_DIMENSiONOPERATION => _("Dimension Operations"),
226         // maintenance and analytics
227         SA_DIMENSIONANALYTIC => _("Dimension analytical reports and inquiries"),
228                 _("Dimension Reports"),
229                 _("Dimension other reports and inquiries"),
230         // database table crud operations and administrative areas
231         SA_BANKACCOUNT => _("Bank Accounts"),
232                 _("Quick Entries"),
233                 _("Currencies"),
234                 _("Exchange Rates"),
235                 _("GL Accounts"),
236                 _("GL Account Groups"),
237                 _("GL Account Classes"),
238         // documents, transactions entry
239         SA_PAYMENT => _("Bank Payments"),
240                 _("Bank Deposits"),
241                 _("Bank Account Transfers"),
242                 _("Journal Entries"),
243                 _("Budget Entries"),
244                 _("Bank Reconcile"),
245         // maintenance and analytics
246         SA_GLANALYTIC => _("Bank and GL analytical reports and inquiries"),
247                 _("Bank and GL Reports"),
248                 _("Bank and GL other reports and inquiries"),
249         // database table crud operations and administrative areas
250         SA_SETUPCOMPANY => _("Company Setup"),
251                 _("Users Setup"),
252                 _("Forms Setup"),
253                 _("Taxes"),
254                 _("Fiscal Years"),
255                 _("Print Profiles"),
256                 _("Payment Terms"),
257                 _("Shipping"),
258                 _("Point of Sales"),
259                 _("Printer Setup"),
260         // documents, transactions entry
261         SA_VOIDTRANSACTION => _("Voiding Transactions"),
262                 _("Viev and Print Transactions"),
263                 _("Attaching Documents"),
264                 _("Backup and Restore"),
265                 _("Install/Update Companies"),
266                 _("Install/Update Languages"),
267                 _("Install/Upgrade Modules"),
268                 _("Software Upgrades"),
269 );
270 ?>