Modify

Opened 4 years ago

Closed 2 years ago

#7324 closed enhancement (fixed)

Add support for autocomplete users on admin permissions page

Reported by: chrisheller Owned by: rjollos
Priority: normal Component: AutocompleteUsersPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

We have added support for doing autocompletion of the subject on the Trac admin permissions page.

Autocompleting the "Add Subject to Group" is relatively straightforward.

Autocompleting the "Grant Permission" is a little bit trickier because you may also be granting permissions to groups. For that, we added general support to optionally specify that the returned list should include groups and pass that along in the request for subjects when granting permissions.

The PermissionSystem component does not have direct support for just getting the list of groups, so SQL is done against the permission table to dig out the list, which is then also filtered by the search criteria. Any matching groups are then added to the end of the user list (as opposed to sorting them into the user list itself).

Attachments (2)

autocomplete_perms.js (216 bytes) - added by chrisheller 4 years ago.
JavaScript for autocompletion on admin permission page
autocomplete_perms.patch (3.1 KB) - added by chrisheller 4 years ago.
Modifications to autocompleteusers.py for autocompleting admin perms

Download all attachments as: .zip

Change History (10)

Changed 4 years ago by chrisheller

JavaScript for autocompletion on admin permission page

Changed 4 years ago by chrisheller

Modifications to autocompleteusers.py for autocompleting admin perms

comment:1 Changed 4 years ago by rjollos

  • Owner changed from k0s to rjollos

Changing ticket owner to be new maintainer.

comment:2 Changed 2 years ago by rjollos

This has been implemented in mitar's branch a91a35e5f6f7 and will be pulled in shortly.

comment:3 Changed 2 years ago by rjollos

#4832 closed as a duplicate.

comment:4 Changed 2 years ago by rjollos

#4832 also requests autocomplete support for the Components admin panel (and provides a patch) and for the SvnAuthzAdminPlugin. For the latter, we should add generalized support for adding autocomplete to fields, specified through trac.ini options.

comment:5 Changed 2 years ago by rjollos

  • Status changed from new to assigned

There are a couple of potential issues with this patch:

  • It assumes groups starts with an '@' character.
  • The sg_group field is not autocompleted.

comment:6 Changed 2 years ago by rjollos

(In [11730]) Refs #7324: Added support for autocompleting users and groups on the admin permissions page. Thanks to chrisheller for the initial patch.

comment:7 Changed 2 years ago by rjollos

Code review and other feedback are welcome and appreciated. My development plan is:

  • #6427 + #6444 + #7324 + #8477 (and possibly #4442) -> 0.4.2 (Trac 0.11+)
  • #8438 + #9599 (and possibly #7605) -> 0.5 (Trac 0.12+)
  • Make compatible with Trac 1.0 by using jQuery UI that ships with Trac, assuming that it has Autocomplete support bundled in. This would be similar to the work I'm doing for the DateFieldPlugin in #10107.

comment:8 Changed 2 years ago by rjollos

  • Resolution set to fixed
  • Status changed from assigned to closed

Fix is in the current dev version of the trunk and will be released with version 0.4.2 of the plugin.

Add Comment

Modify Ticket

Action
as closed The owner will remain rjollos.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.