~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/code/browser/branch.py

[r=sinzui][bug=605130] (Landed on behalf of wallyworld) Grant
 LimitedView to private team branch subscribers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
    stepthrough,
97
97
    stepto,
98
98
    )
99
 
from canonical.launchpad.webapp.authorization import check_permission
 
99
from canonical.launchpad.webapp.authorization import (
 
100
    check_permission,
 
101
    precache_permission_for_objects,
 
102
    )
100
103
from canonical.launchpad.webapp.interfaces import ICanonicalUrlData
101
104
from canonical.launchpad.webapp.menu import structured
102
105
from lp.app.browser.launchpad import Hierarchy
442
445
    def initialize(self):
443
446
        self.branch = self.context
444
447
        self.notices = []
 
448
        # Cache permission so private team owner can be rendered.
 
449
        authorised_people = [self.branch.owner]
 
450
        if self.user is not None:
 
451
            precache_permission_for_objects(
 
452
                self.request, "launchpad.LimitedView", authorised_people)
445
453
        # Replace our context with a decorated branch, if it is not already
446
454
        # decorated.
447
455
        if not isinstance(self.context, DecoratedBranch):