@@ -0,0 +1,1232 @@
+from trac.core import *%0Afrom trac.config import ListOption%0Afrom trac.perm import IPermissionPolicy, IPermissionRequestor, PermissionSystem%0Afrom trac.ticket.model import Ticket%0A%0A%0Aclass SecurityTicketsPolicy(Component):%0A    %22%22%22%0A    Require the VULNERABILITY_VIEW permission to view any ticket with the words%0A    %22security%22 or %22vulnerability%22 in the summary or keywords fields.%0A    %22%22%22%0A    implements(IPermissionPolicy, IPermissionRequestor)%0A%0A    # IPermissionPolicy methods%0A    def check_permission(self, username, action, context):%0A        # Find available ticket context%0A        while context.parent:%0A            if context.realm == 'ticket':%0A                break%0A            context = context.parent%0A%0A        if context.realm == 'ticket' and context.id is not None:%0A            ticket = Ticket(self.env, context.id)%0A            fields = (ticket%5B'keywords'%5D + ticket%5B'summary'%5D).lower()%0A            if 'security' in fields or 'vulnerability' in fields:%0A                perms = PermissionSystem(self.env).get_user_permissions(username)%0A                if 'VULNERABILITY_VIEW' not in perms:%0A                    return False%0A%0A    # IPermissionRequestor methods%0A    def get_permission_actions(self):%0A        yield 'VULNERABILITY_VIEW'%0A

Add the `vulnerability_tickets.py` sample security plugin to deny access to tickets with "security" or "vulnerability" in the `keywords` or `summary` fields.