Modify

Opened 12 years ago

Closed 7 years ago

#9853 closed enhancement (wontfix)

[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

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 (3)

comment:1 Changed 12 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 8 years ago by Ryan J Ollos

Type: defectenhancement

comment:3 Changed 7 years ago by Ryan J Ollos

Resolution: wontfix
Status: newclosed

This has a pretty narrow use case so I'm not going to apply the patch unless anyone else is still interested in it.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.