source: main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/customers/permissions.py @ 12098

Last change on this file since 12098 was 11967, checked in by Henrik Bettermann, 10 years ago

Add browser components for customers. Tests will follow.

File size: 3.0 KB
Line 
1## $Id: permissions.py 10465 2013-08-07 11:18:43Z henrik $
2##
3## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17##
18"""
19Permissions for the customer section.
20"""
21import grok
22
23# Customer section permissions
24
25class HandleCustomer(grok.Permission):
26    grok.name('waeup.handleCustomer')
27
28class ViewCustomer(grok.Permission):
29    grok.name('waeup.viewCustomer')
30
31class ViewCustomersTab(grok.Permission):
32    grok.name('waeup.viewCustomersTab')
33
34class ViewMyCustomerDataTab(grok.Permission):
35    grok.name('waeup.viewMyCustomerDataTab')
36
37class ViewCustomersContainer(grok.Permission):
38    grok.name('waeup.viewCustomersContainer')
39
40class PayCustomer(grok.Permission):
41    grok.name('waeup.payCustomer')
42
43class UploadCustomerFile(grok.Permission):
44    grok.name('waeup.uploadCustomerFile')
45
46class ManageCustomer(grok.Permission):
47    grok.name('waeup.manageCustomer')
48
49class LoginAsCustomer(grok.Permission):
50    grok.name('waeup.loginAsCustomer')
51
52class TriggerTransition(grok.Permission):
53    grok.name('waeup.triggerTransition')
54
55# Local role
56class CustomerRecordOwner(grok.Role):
57    grok.name('waeup.local.CustomerRecordOwner')
58    grok.title(u'Customer Record Owner')
59    grok.permissions('waeup.handleCustomer', 'waeup.uploadCustomerFile',
60                     'waeup.viewCustomer', 'waeup.payCustomer')
61
62# Site Roles
63class CustomerRole(grok.Role):
64    grok.name('waeup.Customer')
65    grok.title(u'Customer (do not assign)')
66    grok.permissions('waeup.viewProducts', 'waeup.viewMyCustomerDataTab',
67                     'waeup.Authenticated')
68
69class CustomersOfficer(grok.Role):
70    grok.name('waeup.CustomersOfficer')
71    grok.title(u'Customers Officer (view only)')
72    grok.permissions('waeup.viewCustomer','waeup.viewCustomers',
73          'waeup.viewCustomersTab', 'waeup.viewCustomersContainer')
74
75class CustomersManager(grok.Role):
76    grok.name('waeup.CustomersManager')
77    grok.title(u'Customers Manager')
78    grok.permissions('waeup.viewCustomer', 'waeup.viewCustomers',
79                     'waeup.manageCustomer', 'waeup.viewCustomersContainer',
80                     'waeup.payCustomer', 'waeup.uploadCustomerFile',
81                     'waeup.viewCustomersTab', 'waeup.triggerTransition')
82
83class CustomerImpersonator(grok.Role):
84    grok.name('waeup.CustomerImpersonator')
85    grok.title(u'Customer Impersonator')
86    grok.permissions('waeup.loginAsCustomer')
Note: See TracBrowser for help on using the repository browser.