editable notes
[freeside.git] / FS / FS / AccessRight.pm
1 package FS::AccessRight;
2
3 use strict;
4 use vars qw(@rights); # %rights);
5 use Tie::IxHash;
6
7 =head1 NAME
8
9 FS::AccessRight - Access control rights.
10
11 =head1 SYNOPSIS
12
13   use FS::AccessRight;
14
15 =head1 DESCRIPTION
16
17 Access control rights - Permission to perform specific actions that can be
18 assigned to users and/or groups.
19
20 =cut
21
22 #@rights = (
23 #  'Reports' => [
24 #    '_desc' => 'Access to high-level reporting',
25 #  ],
26 #  'Configuration' => [
27 #    '_desc' => 'Access to configuration',
28 #
29 #    'Settings' => {},
30 #
31 #    'agent' => [
32 #      '_desc' => 'Master access to reseller configuration',
33 #      'agent_type'  => {},
34 #      'agent'       => {},
35 #    ],
36 #
37 #    'export_svc_pkg' => [
38 #      '_desc' => 'Access to export, service and package configuration',
39 #      'part_export' => {},
40 #      'part_svc'    => {},
41 #      'part_pkg'    => {},
42 #      'pkg_class'   => {},
43 #    ],
44 #
45 #    'billing' => [
46 #      '_desc' => 'Access to billing configuration',
47 #      'payment_gateway'  => {},
48 #      'part_bill_event'  => {},
49 #      'prepay_credit'    => {},
50 #      'rate'             => {},
51 #      'cust_main_county' => {},
52 #    ],
53 #
54 #    'dialup' => [
55 #      '_desc' => 'Access to dialup configuraiton',
56 #      'svc_acct_pop' => {},
57 #    ],
58 #
59 #    'broadband' => [
60 #      '_desc' => 'Access to broadband configuration',
61 #      'router'     => {},
62 #      'addr_block' => {},
63 #    ],
64 #
65 #    'misc' => [
66 #      'part_referral'      => {},
67 #      'part_virtual_field' => {},
68 #      'msgcat'             => {},
69 #      'inventory_class'    => {},
70 #    ],
71 #
72 #  },
73 #
74 #);
75 #
76 ##turn it into a more hash-like structure, but ordered via IxHash
77
78 #well, this is what we have for now.  could be ordered better, could be lots of
79 # things better, but this ACL system does 99% of what folks need and the UI
80 # isn't *that* bad
81
82 # okay, well it *really* needs some catgorization in the UI.  badly.
83 @rights = (
84
85 ##
86 # basic customer rights
87 ##
88   'New customer',
89   'View customer',
90   #'View Customer | View tickets',
91   'Edit customer',
92   'Cancel customer',
93   'Complimentary customer', #aka users-allow_comp 
94   'Delete customer', #aka. deletecustomers #Enable customer deletions. Be very careful! Deleting a customer will remove all traces that this customer ever existed! It should probably only be used when auditing a legacy database. Normally, you cancel all of a customers' packages if they cancel service.
95   'Add customer note',
96   'Edit customer note',
97
98 ###
99 # customer package rights
100 ###
101   'Order customer package',
102   'One-time charge',
103   'Change customer package',
104   'Bulk change customer packages',
105   'Edit customer package dates',
106   'Customize customer package',
107   'Suspend customer package',
108   'Unsuspend customer package',
109   'Cancel customer package immediately',
110   'Cancel customer package later',
111   'Add on-the-fly cancel reason',
112   'Add on-the-fly suspend reason',
113
114 ###
115 # customer service rights
116 ###
117   'Provision customer service',
118   'Unprovision customer service',
119
120   'View/link unlinked services', #not agent-virtualizable without more work
121
122 ###
123 # customer invoice/financial info rights
124 ###
125   'View invoices',
126   'View customer tax exemptions', #yow
127
128 ###
129 # customer payment rights
130 ###
131   'Post payment',
132   'Post payment batch',
133   'Unapply payment', #aka. unapplypayments Enable "unapplication" of unclosed payments.
134   'Process payment',
135   'Refund payment',
136
137   'Delete payment', #aka. deletepayments - Enable deletion of unclosed payments. Be very careful! Only delete payments that were data-entry errors, not adjustments. Optionally specify one or more comma-separated email addresses to be notified when a payment is deleted.
138
139 ###
140 # customer credit rights
141 ###
142   'Post credit',
143   #'Apply credit',
144   'Unapply credit', #aka unapplycredits Enable "unapplication" of unclosed credits.
145   'Delete credit', #aka. deletecredits Enable deletion of unclosed credits. Be very careful! Only delete credits that were data-entry errors, not adjustments. Optionally specify one or more comma-separated email addresses to be notified when a credit is deleted.
146
147 ###
148 # customer voiding rights..
149 ###
150   'Credit card void', #aka. cc-void #Enable local-only voiding of echeck payments in addition to refunds against the payment gateway
151   'Echeck void', #aka. echeck-void #Enable local-only voiding of echeck payments in addition to refunds against the payment gateway
152   'Regular void',
153   'Unvoid', #aka. unvoid #Enable unvoiding of voided payments
154
155 ###
156 # report/listing rights...
157 ###
158   'List customers',
159   #'List zip codes',
160   'List invoices',
161   'List packages',
162   'List services',
163
164   'List rating data',  # 'Usage reports',
165   'Billing event reports',
166   'Financial reports',
167
168 ###
169 # misc rights
170 ###
171   'Job queue',         # these are not currently agent-virtualized
172   'Process batches',   #
173   'Reprocess batches', #
174   'Import',            #
175   'Export',            #
176
177 ###
178 # setup/config rights
179 ###
180   'Edit advertising sources',
181   'Edit global advertising sources',
182
183   'Configuration', #most of the rest of the configuraiton is not
184                    # agent-virtualized
185 );
186
187 sub rights {
188   @rights;
189 }
190