Modify ↓
Opened 8 years ago
Last modified 4 years ago
#13014 new enhancement
Deprecate and remove IPermissionStore.get_users_with_permission
| Reported by: | Ryan J Ollos | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | next-dev-1.7.x |
| Component: | general | Version: | |
| Severity: | normal | Keywords: | permissions |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
This is a follow-on to comment:15:ticket:12915.
The proposed changes are:
- Change
DefaultPermissionStore.get_user_permissionsso thatIPermissionGroupProvidersare not searched.PermissionSystem.get_user_permissionswill searchIPermissionGroupProviders.DefaultPermissionStorewill no longer have any knowledge ofIPermissionGroupProviders that it does not implement. - Deprecate
IPermissionStore.get_users_with_permissionsand remove it in 1.5.1.- The method was added in #4245.
- LdapPlugin is the only plugin on trac-hacks.org that implements
IPermissionStore, and it has copied the implementation of DefaultPermissionStore.get_users_with_permissions. PermissionSystem.get_users_with_permissioncan do the equivalent work for allIPermissionStores.
- Change
PermissionSystem.get_users_with_permissionso that it does not callIPermissionStore.get_users_with_permissions.
Attachments (0)
Change History (10)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
[52b42e0d/rjollos.git] proposes to make DefaultPermissionStore.get_user_permissions unaware of other IPermissionGroupProviders.
- However,
DefaultPermissionStore.get_user_permissionsstill returns actions for a user that are inherited fromDefaultPermissionStoregroups that the user is a member of. PermissionSystem.get_user_permissionsis responsible for determining group membership for groups defined by otherIPermissionGroupProviders.- The
IPermissionStore.get_user_permissionsinterface is changed to require accepting a tuple of subjects (users and groups).
I've been debating a few points:
- I favor changing
DefaultPermissionStoreto be unaware of allIPermissionGroupProviders because that work is better done byPermissionSystemand doesn't have to be repeated by everyIPermissionStoreimplementation. TheIPermissionStores have a more narrow and well-defined role. However, if this change leads to too many complications, the proposed change should be dropped. - With that in mind, maybe
DefaultPermissionStore.get_user_permissionsshould only return actions for the specified subjects and not includeDefaultPermissionStoregroups that the user is a member of. TheDefaultPermissionStoregroups would be discovered by the query inPermissionSystem.get_user_permissions. The downside is that it results in two database queries, one to find the groups and one to find the actions for subjects. - Otherwise, we could explicitly document the rule. If the component implementing
IPermissionStoredefines groups through anIPermissionGroupProviderimplementation,get_user_permissionsshould return actions inherited from those groups for all subjects.
comment:3 by , 7 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:4 by , 7 years ago
| Milestone: | 1.3.4 → 1.5.1 |
|---|
comment:5 by , 6 years ago
| Milestone: | 1.5.1 → 1.5.3 |
|---|
comment:6 by , 5 years ago
| Milestone: | 1.5.3 → 1.7 |
|---|
comment:8 by , 4 years ago
| Milestone: | 1.7.1 |
|---|---|
| Owner: | removed |
| Status: | assigned → new |
comment:9 by , 4 years ago
| Milestone: | → 1.7.1 |
|---|
comment:10 by , 4 years ago
| Milestone: | 1.7.1 → next-dev-1.7.x |
|---|
Note:
See TracTickets
for help on using tickets.



Changes in log:rjollos.git:t13014_remove_get_users_with_permission. Need to add more test coverage and check performance implications.