Feature/41086 work package assigned capability#10244
Merged
oliverguenther merged 4 commits intoMar 7, 2022
Merged
Conversation
cdc718d to
e7e5e8b
Compare
e7e5e8b to
112a085
Compare
112a085 to
d18f60a
Compare
oliverguenther
approved these changes
Mar 7, 2022
Member
oliverguenther
left a comment
There was a problem hiding this comment.
It might be worthwhile to calculate the active permissions into a persisted view consisting of the columns principal_id, project_id, permission which gets updated whenever the original tables are altered but after that serve as the source of truth for whenever permissions are checked.
That way, checking permissions will become very easy and performant.
- 1 from my side.
akabiru
added a commit
that referenced
this pull request
May 6, 2026
…antic ids
The autocomplete dropdown in CKEditor renders each result with
`item.name = wp.to_s`, and `to_s` hardcoded `##{id}` — so a semantic-mode
search for `#KSTP-2` resolved correctly but the dropdown row showed
`Task #10244: Subject` instead of `Task KSTP-2: Subject`.
Switch to `formatted_id`, which already produces the user-facing form in
both modes (`PROJ-7` semantic, `#42` classic). The other caller — the
delete-dialog component — benefits from the same mode awareness.
akabiru
added a commit
that referenced
this pull request
May 7, 2026
…antic ids
The autocomplete dropdown in CKEditor renders each result with
`item.name = wp.to_s`, and `to_s` hardcoded `##{id}` — so a semantic-mode
search for `#KSTP-2` resolved correctly but the dropdown row showed
`Task #10244: Subject` instead of `Task KSTP-2: Subject`.
Switch to `formatted_id`, which already produces the user-facing form in
both modes (`PROJ-7` semantic, `#42` classic). The other caller — the
delete-dialog component — benefits from the same mode awareness.
pull Bot
pushed a commit
to soitun/openproject
that referenced
this pull request
May 14, 2026
…antic ids
The autocomplete dropdown in CKEditor renders each result with
`item.name = wp.to_s`, and `to_s` hardcoded `##{id}` — so a semantic-mode
search for `#KSTP-2` resolved correctly but the dropdown row showed
`Task opf#10244: Subject` instead of `Task KSTP-2: Subject`.
Switch to `formatted_id`, which already produces the user-facing form in
both modes (`PROJ-7` semantic, `#42` classic). The other caller — the
delete-dialog component — benefits from the same mode awareness.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces a permission that when granted, allows a user to have work packages assigned to her/him. This replaces the flag on members
assignablethat previously governed the same behaviour.This is also reflected in the role administration where the newly introduced passive permission was added to the work packages fieldset.
As this permission might be hard to understand, the ability to add explanations for a permission was introduced.
The change was made mostly so that the permission can become part of the capabilities api in the form of
work_packages/assigned. Currently, this is meant to represent both the ability to become assignee as well as responsible but if necessary, this can be split up.Because administrators should not receive this permission, a new flag is introduced for permissions to govern this which required changes to various permission queries.
When working on fixing specs, a former patch was now properly included into the previously patched file since the distinction is no longer necessary and causes errors at least when run in development mode (cost types where not displayed on cost report page).
The migration included not only replaced the
assignablecolumn but also removesrole_permissionsentries that are orphaned as the referenced role got removed. This should no longer happen now since the relation now has adependent: :destroyadded to it.Lessons learned
Currently, there are various places in which permissions are derived from the originally involved tables:
members,member_roles,roles,role_permissions. Those all have to be altered when the way permissions are checked changes. Additionally, this is all done repeatedly whenever a permission needs to be checked.It might be worthwhile to calculate the active permissions into a persisted view consisting of the columns
principal_id,project_id,permissionwhich gets updated whenever the original tables are altered but after that serve as the source of truth for whenever permissions are checked.That way, checking permissions will become very easy and performant.
Updating can the view can happen asynchronously but needs to happen whenever the original data changes. This can be done either on the database level via database triggers or via update requests issued from rails.
TODO
assignablecolumnassignable = truereceives the new permissionassignableproperty is modified.https://community.openproject.org/wp/41086