source: main/waeup.ikoba/trunk/src/waeup/ikoba/customers/permissions.py @ 11962

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

Add components for customer management. Some tests are still missing.

File size: 2.9 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
52# Local role
53class CustomerRecordOwner(grok.Role):
54    grok.name('waeup.local.CustomerRecordOwner')
55    grok.title(u'Customer Record Owner')
56    grok.permissions('waeup.handleCustomer', 'waeup.uploadCustomerFile',
57                     'waeup.viewCustomer', 'waeup.payCustomer')
58
59# Site Roles
60class CustomerRole(grok.Role):
61    grok.name('waeup.Customer')
62    grok.title(u'Customer (do not assign)')
63    grok.permissions('waeup.viewProducts', 'waeup.viewMyCustomerDataTab',
64                     'waeup.Authenticated')
65
66class CustomersOfficer(grok.Role):
67    grok.name('waeup.CustomersOfficer')
68    grok.title(u'Customers Officer (view only)')
69    grok.permissions('waeup.viewCustomer','waeup.viewCustomers',
70          'waeup.viewCustomersTab', 'waeup.viewCustomersContainer')
71
72class CustomersManager(grok.Role):
73    grok.name('waeup.CustomersManager')
74    grok.title(u'Customers Manager')
75    grok.permissions('waeup.viewCustomer', 'waeup.viewCustomers',
76                     'waeup.manageCustomer', 'waeup.viewCustomersContainer',
77                     'waeup.payCustomer', 'waeup.uploadCustomerFile',
78                     'waeup.viewCustomersTab')
79
80class CustomerImpersonator(grok.Role):
81    grok.name('waeup.CustomerImpersonator')
82    grok.title(u'Customer Impersonator')
83    grok.permissions('waeup.loginAsCustomer')
Note: See TracBrowser for help on using the repository browser.