Opened 5 years ago

Last modified 13 months ago

#9853 new enhancement

[Patch] Make everyone use the simple form

Reported by: HumanInternals Owned by: Ryan J Ollos
Priority: normal Component: SimpleTicketPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11


Currently, its impossible for TRAC_ADMIN users to use the simple ticket form. In some cases, it is desirable for all users, including admins, to see the shorter form.

This adds a new everyone option to the configuration, that makes it ignore permissions completely and make everyone use the simple form:

  • simpleticket/

    1515    show_only = BoolOption('simpleticket', 'show_only', default=False,
    1616                           doc='If True, show only the specified fields rather than hiding the specified fields')
     18    everyone = BoolOption('simpleticket', 'everyone', default=False,
     19                          doc='If true, effect everyone regardless of permissions.')
    1821    implements(IRequestFilter, IPermissionRequestor)
    2023    # IRequestFilter methods
    2427    def post_process_request(self, req, template, data, content_type):
    2528        if req.path_info == '/newticket':
    26             do_filter = 'TICKET_CREATE_SIMPLE' in req.perm and not 'TRAC_ADMIN' in req.perm           
     29            do_filter = self.everyone or ('TICKET_CREATE_SIMPLE' in req.perm and not 'TRAC_ADMIN' in req.perm)
    2831            self.log.debug('SimpleTicket: Filtering new ticket form for %s', req.authname)
    2932            if do_filter:

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by Ryan J Ollos

Summary: Make everyone use the simple form[Patch] Make everyone use the simple form

Thanks for the patch. It looks good. I'd like to change the name of the TracIni configuration option, but otherwise will apply the patch as is. It will probably be a week or two since I'm very busy at the moment.

comment:2 Changed 13 months ago by Ryan J Ollos

Type: defectenhancement

Modify Ticket

as new The owner will remain Ryan J Ollos.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.