3 | | Some things to consider: |
4 | | * [browser:tags/trac-1.3.2/trac/perm.py@:443-444#L440 get_user_permissions] is similarly named, but returns a dictionary. I have never understood the usefulness of mapping all the keys to `True`, so I chose to return a sorted list from `get_user_groups`. |
5 | | * `get_user_permissions` returns all permissions when `username` is `None`. The same can't easily be done for `get_user_permissions` because `IPermissionGroupProvider`s don't return all groups when `username` is `None`. I'm not even sure we'd want that behavior for [browser:tags/trac-1.3.2/trac/perm.py@:274-278#L265 DefaultPermissionGroupProvider]. We'd probably need to add a `get_all_groups` method to the `IPermissionGroupProvider` interface. |
6 | | * [browser:/tags/trac-1.3.2/trac/perm.py#L413 get_groups_dict] doesn't really return all groups, because it doesn't account for `IPermissionGroupProvider`s. We'd probably need the `DefaultPermissionGroupProvider.get_all_groups` method for it to return all groups. This could be considered a defect in [browser:tags/trac-1.3.2/trac/ticket/default_workflow.py@:539,551#L534 group expansion] of the `set_owner` field. |
7 | | |
8 | | These issues should probably be dealt with in the context of a redesign of the permissions system rather than piecewise changes. |
| 3 | 1. [browser:tags/trac-1.3.2/trac/perm.py@:443-444#L440 get_user_permissions] is similarly named, but returns a dictionary. I have never understood the usefulness of mapping all the keys to `True`, so I chose to return a sorted list from `get_user_groups`. |
| 4 | 1. `get_user_permissions` returns all permissions when `username` is `None`. The same can't easily be done for `get_user_permissions` because `IPermissionGroupProvider`s don't return all groups when `username` is `None`. I'm not even sure we'd want that behavior for [browser:tags/trac-1.3.2/trac/perm.py@:274-278#L265 DefaultPermissionGroupProvider]. We'd probably need to add a `get_all_groups` method to the `IPermissionGroupProvider` interface. |
| 5 | 1. [browser:/tags/trac-1.3.2/trac/perm.py#L413 get_groups_dict] doesn't really return all groups, because it doesn't account for `IPermissionGroupProvider`s. We'd probably need the `DefaultPermissionGroupProvider.get_all_groups` method for it to return all groups. This could be considered a defect in [browser:tags/trac-1.3.2/trac/ticket/default_workflow.py@:539,551#L534 group expansion] of the `set_owner` field. |