~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/model/personroles.py

[r=sinzui][bug=885672] Allow users in project roles and the comment
 owner to hide/unhide bug comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
from zope.interface import implements
14
14
 
15
15
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
 
16
from lp.bugs.interfaces.bugsupervisor import IHasBugSupervisor
 
17
from lp.bugs.interfaces.securitycontact import IHasSecurityContact
16
18
from lp.registry.interfaces.person import IPerson
17
19
from lp.registry.interfaces.role import (
18
20
    IHasDrivers,
49
51
        """See IPersonRoles."""
50
52
        return self.person.inTeam(obj.owner)
51
53
 
 
54
    def isBugSupervisor(self, obj):
 
55
        """See IPersonRoles."""
 
56
        return (IHasBugSupervisor.providedBy(obj)
 
57
                and self.person.inTeam(obj.bug_supervisor))
 
58
 
 
59
    def isSecurityContact(self, obj):
 
60
        """See IPersonRoles."""
 
61
        return (IHasSecurityContact.providedBy(obj)
 
62
                and self.person.inTeam(obj.security_contact))
 
63
 
52
64
    def isDriver(self, obj):
53
65
        """See IPersonRoles."""
54
66
        return self.person.inTeam(obj.driver)