[12015] | 1 | ## $Id: permissions.py 12097 2014-11-30 20:49:22Z henrik $ |
---|
[11958] | 2 | ## |
---|
[12065] | 3 | ## Copyright (C) 2014 Uli Fouquet & Henrik Bettermann |
---|
[11958] | 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 | |
---|
[11985] | 25 | |
---|
[11958] | 26 | class HandleCustomer(grok.Permission): |
---|
| 27 | grok.name('waeup.handleCustomer') |
---|
| 28 | |
---|
[11985] | 29 | |
---|
[11958] | 30 | class ViewCustomer(grok.Permission): |
---|
| 31 | grok.name('waeup.viewCustomer') |
---|
| 32 | |
---|
[11985] | 33 | |
---|
[11958] | 34 | class ViewCustomersTab(grok.Permission): |
---|
| 35 | grok.name('waeup.viewCustomersTab') |
---|
| 36 | |
---|
[11985] | 37 | |
---|
[11958] | 38 | class ViewMyCustomerDataTab(grok.Permission): |
---|
| 39 | grok.name('waeup.viewMyCustomerDataTab') |
---|
| 40 | |
---|
[11985] | 41 | |
---|
[11958] | 42 | class ViewCustomersContainer(grok.Permission): |
---|
| 43 | grok.name('waeup.viewCustomersContainer') |
---|
| 44 | |
---|
[11985] | 45 | |
---|
[12015] | 46 | class EditCustomerDocuments(grok.Permission): |
---|
| 47 | grok.name('waeup.editCustomerDocuments') |
---|
[11958] | 48 | |
---|
[11985] | 49 | |
---|
[12097] | 50 | class EditContracts(grok.Permission): |
---|
| 51 | grok.name('waeup.editContracts') |
---|
[12090] | 52 | |
---|
| 53 | |
---|
[11958] | 54 | class UploadCustomerFile(grok.Permission): |
---|
| 55 | grok.name('waeup.uploadCustomerFile') |
---|
| 56 | |
---|
[11985] | 57 | |
---|
[11958] | 58 | class ManageCustomer(grok.Permission): |
---|
| 59 | grok.name('waeup.manageCustomer') |
---|
| 60 | |
---|
[11985] | 61 | |
---|
[11958] | 62 | class LoginAsCustomer(grok.Permission): |
---|
| 63 | grok.name('waeup.loginAsCustomer') |
---|
| 64 | |
---|
[11985] | 65 | |
---|
[11967] | 66 | class TriggerTransition(grok.Permission): |
---|
| 67 | grok.name('waeup.triggerTransition') |
---|
| 68 | |
---|
[11985] | 69 | |
---|
[11958] | 70 | # Local role |
---|
| 71 | class CustomerRecordOwner(grok.Role): |
---|
| 72 | grok.name('waeup.local.CustomerRecordOwner') |
---|
| 73 | grok.title(u'Customer Record Owner') |
---|
| 74 | grok.permissions('waeup.handleCustomer', 'waeup.uploadCustomerFile', |
---|
[12091] | 75 | 'waeup.viewCustomer', 'waeup.editCustomerDocuments', |
---|
[12097] | 76 | 'waeup.editContracts') |
---|
[11958] | 77 | |
---|
[11985] | 78 | |
---|
[11958] | 79 | # Site Roles |
---|
| 80 | class CustomerRole(grok.Role): |
---|
| 81 | grok.name('waeup.Customer') |
---|
| 82 | grok.title(u'Customer (do not assign)') |
---|
| 83 | grok.permissions('waeup.viewProducts', 'waeup.viewMyCustomerDataTab', |
---|
| 84 | 'waeup.Authenticated') |
---|
| 85 | |
---|
[11985] | 86 | |
---|
[11958] | 87 | class CustomersOfficer(grok.Role): |
---|
| 88 | grok.name('waeup.CustomersOfficer') |
---|
| 89 | grok.title(u'Customers Officer (view only)') |
---|
| 90 | grok.permissions('waeup.viewCustomer','waeup.viewCustomers', |
---|
| 91 | 'waeup.viewCustomersTab', 'waeup.viewCustomersContainer') |
---|
| 92 | |
---|
[11985] | 93 | |
---|
[11958] | 94 | class CustomersManager(grok.Role): |
---|
| 95 | grok.name('waeup.CustomersManager') |
---|
| 96 | grok.title(u'Customers Manager') |
---|
| 97 | grok.permissions('waeup.viewCustomer', 'waeup.viewCustomers', |
---|
| 98 | 'waeup.manageCustomer', 'waeup.viewCustomersContainer', |
---|
[12015] | 99 | 'waeup.editCustomerDocuments', 'waeup.uploadCustomerFile', |
---|
[12090] | 100 | 'waeup.viewCustomersTab', 'waeup.triggerTransition', |
---|
[12097] | 101 | 'waeup.editContracts') |
---|
[11958] | 102 | |
---|
[11985] | 103 | |
---|
[11958] | 104 | class CustomerImpersonator(grok.Role): |
---|
| 105 | grok.name('waeup.CustomerImpersonator') |
---|
| 106 | grok.title(u'Customer Impersonator') |
---|
[11985] | 107 | grok.permissions('waeup.loginAsCustomer') |
---|