Modify

Opened 3 years ago

Last modified 3 years ago

#9853 new defect

[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

Description

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/web_ui.py

     
    1515    show_only = BoolOption('simpleticket', 'show_only', default=False, 
    1616                           doc='If True, show only the specified fields rather than hiding the specified fields') 
    1717 
     18    everyone = BoolOption('simpleticket', 'everyone', default=False, 
     19                          doc='If true, effect everyone regardless of permissions.') 
     20 
    1821    implements(IRequestFilter, IPermissionRequestor) 
    1922 
    2023    # IRequestFilter methods 
     
    2326             
    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) 
    2730             
    2831            self.log.debug('SimpleTicket: Filtering new ticket form for %s', req.authname) 
    2932            if do_filter: 

Attachments (0)

Change History (1)

comment:1 Changed 3 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.

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.