Edgewall Software

Changes between Version 1 and Version 2 of Ticket #12915, comment 1


Ignore:
Timestamp:
Sep 24, 2017, 2:12:29 PM (5 years ago)
Author:
Ryan J Ollos

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12915, comment 1

    v1 v2  
    11Proposed changes in [3fdd6a387/rjollos.git]. Example use: [attachment:privateticketsplugin.diff].
    22
    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.
     31. [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`.
     41. `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.
     51. [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.