#12915 closed enhancement (fixed)
Add method to PermissionSystem for retrieving user groups — at Version 2
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.3.3 |
Component: | general | Version: | |
Severity: | normal | Keywords: | permissions |
Cc: | Branch: | ||
Release Notes: |
Added |
||
API Changes: | |||
Internal Changes: |
Description
I have wanted a method of PermissionSystem
for retrieving all groups that a user belongs to, both those defined in the permissions
table and in IPermissionGroupProvider
s.
Change History (3)
by , 7 years ago
Attachment: | privateticketsplugin.diff added |
---|
comment:2 by , 7 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Committed to trunk in r16326.
Note:
See TracTickets
for help on using tickets.
Proposed changes in [3fdd6a387/rjollos.git]. Example use: privateticketsplugin.diff.
True
, so I chose to return a sorted list fromget_user_groups
.get_user_permissions
returns all permissions whenusername
isNone
. The same can't easily be done forget_user_groups
becauseIPermissionGroupProvider
s don't return all groups whenusername
isNone
. I'm not even sure we'd want that behavior for DefaultPermissionGroupProvider. We'd probably need to add aget_all_groups
method to theIPermissionGroupProvider
interface.IPermissionGroupProvider
s. We'd probably need theDefaultPermissionGroupProvider.get_all_groups
method for it to return all groups. This could be considered a defect in group expansion of theset_owner
field.