Changeset 4266
- Timestamp:
- 09/11/08 08:52:04 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
timingandestimationplugin/branches/trac0.11-Permissions/timingandestimationplugin/api.py
r4265 r4266 56 56 self.statuses_key = 'T&E-statuses' 57 57 self.db_version_key = 'TimingAndEstimationPlugin_Db_Version' 58 self.db_version = 758 self.db_version = 8 59 59 # Initialise database schema version tracking. 60 60 self.db_installed_version = dbhelper.get_system_value(self, \ … … 114 114 #version 6 upgraded reports 115 115 116 # This statement block always goes at the end this method 117 dbhelper.set_system_value(self, self.db_version_key, self.db_version) 118 self.db_installed_version = self.db_version 116 119 117 if self.db_installed_version < 7: 120 118 field_settings = "field settings" … … 123 121 self.config.set( field_settings, "hours.permission", "TIME_VIEW:remove, TIME_RECORD:disable" ) 124 122 self.config.set( field_settings, "estimatedhours.permission", "TIME_RECORD:disable" ) 123 124 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 125 # This statement block always goes at the end this method 126 dbhelper.set_system_value(self, self.db_version_key, self.db_version) 127 self.db_installed_version = self.db_version 128 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 125 129 126 130 timingandestimationplugin/branches/trac0.11-Permissions/timingandestimationplugin/blackmagic.py
r4264 r4266 75 75 class TicketTweaks(Component): 76 76 implements(ITemplateStreamFilter, ITemplateProvider, IPermissionRequestor) 77 permissions = ListOption(csection, 'permissions', []) 78 gray_disabled = Option(csection, 'gray_disabled', '', 79 doc="""If not set, disabled items will have their label striked through. 80 Otherwise, this color will be used to gray them out. Suggested #cccccc.""") 81 ## IPermissionRequestor methods 82 77 83 78 def get_permission_actions(self): 84 return (x.upper() for x in self.permissions) 79 fields = self.config.getlist(csection, 'fields', []) 80 permissions = self.config.getlist(csection, 'permissions', []) 81 perms = [] 82 for field in fields: 83 perms.extend(self.config.getlist(csection, '%s.permission' % field, [])) 84 for (perm, denial) in [s.split(":") for s in perms]: 85 permissions.append(perm) 86 return (x.upper() for x in permissions) 85 87 86 88 ## ITemplateStreamFilter
