Opened 5 years ago

Last modified 12 months ago

#9853 new enhancement

[Patch] Make everyone use the simple form

Reported by: shesek Owned by: rjollos
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 rjollos

  • Summary changed from Make everyone use the simple form to [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 12 months ago by rjollos

  • Type changed from defect to enhancement

Add Comment

Modify Ticket

as new The owner will remain rjollos.

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

Note: See TracTickets for help on using tickets.