[11958] | 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 | """ |
---|
| 19 | Permissions for the customer section. |
---|
| 20 | """ |
---|
| 21 | import grok |
---|
| 22 | |
---|
| 23 | # Customer section permissions |
---|
| 24 | |
---|
| 25 | class HandleCustomer(grok.Permission): |
---|
| 26 | grok.name('waeup.handleCustomer') |
---|
| 27 | |
---|
| 28 | class ViewCustomer(grok.Permission): |
---|
| 29 | grok.name('waeup.viewCustomer') |
---|
| 30 | |
---|
| 31 | class ViewCustomersTab(grok.Permission): |
---|
| 32 | grok.name('waeup.viewCustomersTab') |
---|
| 33 | |
---|
| 34 | class ViewMyCustomerDataTab(grok.Permission): |
---|
| 35 | grok.name('waeup.viewMyCustomerDataTab') |
---|
| 36 | |
---|
| 37 | class ViewCustomersContainer(grok.Permission): |
---|
| 38 | grok.name('waeup.viewCustomersContainer') |
---|
| 39 | |
---|
| 40 | class PayCustomer(grok.Permission): |
---|
| 41 | grok.name('waeup.payCustomer') |
---|
| 42 | |
---|
| 43 | class UploadCustomerFile(grok.Permission): |
---|
| 44 | grok.name('waeup.uploadCustomerFile') |
---|
| 45 | |
---|
| 46 | class ManageCustomer(grok.Permission): |
---|
| 47 | grok.name('waeup.manageCustomer') |
---|
| 48 | |
---|
| 49 | class LoginAsCustomer(grok.Permission): |
---|
| 50 | grok.name('waeup.loginAsCustomer') |
---|
| 51 | |
---|
[11967] | 52 | class TriggerTransition(grok.Permission): |
---|
| 53 | grok.name('waeup.triggerTransition') |
---|
| 54 | |
---|
[11958] | 55 | # Local role |
---|
| 56 | class 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 |
---|
| 63 | class 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 | |
---|
| 69 | class 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 | |
---|
| 75 | class 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', |
---|
[11967] | 81 | 'waeup.viewCustomersTab', 'waeup.triggerTransition') |
---|
[11958] | 82 | |
---|
| 83 | class CustomerImpersonator(grok.Role): |
---|
| 84 | grok.name('waeup.CustomerImpersonator') |
---|
| 85 | grok.title(u'Customer Impersonator') |
---|
| 86 | grok.permissions('waeup.loginAsCustomer') |
---|