Changeset 4255

Show
Ignore:
Timestamp:
09/10/08 09:50:16 (2 months ago)
Author:
bobbysmith007
Message:

Made a start on a new branch (sponsored by Obsidian Software) that incorporates permissions into T&E

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • timingandestimationplugin/branches/trac0.11-Permissions/setup.py

    r4233 r4255  
    66 
    77setup(name=PACKAGE, 
    8       description='Plugin to make Trac support time estimation and tracking', 
    9       keywords='trac plugin estimation timetracking', 
    10       version='0.7.0', 
     8      description='Plugin to make Trac support time estimation and tracking with permissions', 
     9      keywords='trac plugin estimation timetracking permissions', 
     10      version='0.7.1', 
    1111      url='http://www.trac-hacks.org/wiki/TimingAndEstimationPlugin', 
    1212      license='http://www.opensource.org/licenses/mit-license.php', 
     
    1414      author_email='russ@acceleration.net', 
    1515      long_description=""" 
    16       This Trac 0.11 plugin provides support for Time estimation and tracking. 
     16      This Trac 0.11 plugin provides support for Time estimation and tracking, 
     17      and permissions to view and set those fields 
    1718 
    1819      See http://trac-hacks.org/wiki/TimingAndEstimationPlugin for details. 
     
    2223      entry_points={'trac.plugins': '%s = %s' % (PACKAGE, PACKAGE)}) 
    2324 
     25 
     26#### FINANCIAL CONTRIBUTERS #### 
     27# 
     28# Obsidian Software: http://www.obsidiansoft.com/ 
     29#   Enterprise Solutions for Functional Processor  
     30#   Design Verification 
     31# 
     32################################ 
    2433 
    2534#### AUTHORS #### 
  • timingandestimationplugin/branches/trac0.11-Permissions/timingandestimationplugin/templates/billing.html

    r2774 r4255  
    9595 
    9696  </ul> 
    97   <input type="submit" name="setbillingtime" value="Set Billing Time" onclick="return confirm('Are you sure that you want to create a billed date?')" />&nbsp; 
     97  <input  
     98   py:if="is_time_admin" 
     99   type="submit" name="setbillingtime" value="Set Billing Time" onclick="return confirm('Are you sure that you want to create a billed date?')" />&nbsp; 
    98100 
    99101</div> 
  • timingandestimationplugin/branches/trac0.11-Permissions/timingandestimationplugin/webui.py

    r3784 r4255  
    1919 
    2020class TimingEstimationAndBillingPage(Component): 
    21     implements(INavigationContributor, IRequestHandler, ITemplateProvider) 
     21    implements(IPermissionRequestor, INavigationContributor, IRequestHandler, ITemplateProvider) 
    2222 
    2323    def __init__(self): 
    2424        pass 
     25 
     26    # IPermissionRequestor methods  
     27    def get_permission_actions(self):  
     28        return ["TIME_VIEW", ("TIME_ADMIN", ["TIME_VIEW"]), ("TRAC_ADMIN", ["TIME_VIEW", "TIME_ADMIN"])]  
    2529 
    2630    def set_bill_date(self, username="Timing and Estimation Plugin",  when=0): 
     
    5357    def get_navigation_items(self, req): 
    5458        url = req.href.Billing() 
    55         if req.perm.has_permission("REPORT_VIEW"): 
     59        if req.perm.has_permission("TIME_VIEW"): 
    5660            yield 'mainnav', "Billing", \ 
    5761                  Markup('<a href="%s">%s</a>' % \ 
    58                          (url , "Management")) 
     62                         (url , "Time Reports")) 
    5963 
    6064    # IRequestHandler methods 
     
    8387 
    8488        if req.method == 'POST': 
    85             if req.args.has_key('setbillingtime'): 
    86                 self.set_bill_date(req.authname) 
    87                 addMessage("All tickets last bill date updated") 
     89            if req.perm.has_permission("TIME_ADMIN"):  
     90                if req.args.has_key('setbillingtime'): 
     91                    self.set_bill_date(req.authname) 
     92                    addMessage("All tickets last bill date updated")  
     93            else:  
     94                addMessage("You don't have permission to set a new bill date!")  
     95 
    8896 
    8997        mgr = CustomReportManager(self.env, self.log) 
    9098        data = {}; 
     99        data["is_time_admin"] = req.perm.has_permission("TIME_ADMIN") 
    91100        data["statuses"] = get_statuses(self) 
    92101        data["reports"] = mgr.get_reports_by_group(CustomReportManager.TimingAndEstimationKey);