Repository navigation
fix(backlog): enforce task access on bulk update, create, comments and lookups - #35
Merged
Merged
Conversation
…d lookups Bulk update requires the Backlog permission and only changes tasks the user can edit. Create requires reporting rights in the chosen project. Comments, history and the attachment list are limited to tasks the user can see, and comments are only accepted there. Parent-task search, release export and branch search leave out tasks the user can't see.
|
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.



What and why
Several Backlog actions checked only the Backlog permission, not whether the user belongs to the task's project. Any signed-in user with that permission could read or change tasks in other projects by calling them directly.
BatchUpdate(POST)ManageBacklog; only tasks the user can edit (CanEditTaskAsync) are updated, and the response counts the skipped onesCreate(POST)CommentCreateCanViewTaskAsync)Comments,History,DocumentsCanViewTaskAsync, otherwise the access-denied partialGetParentTasks,ExportReleaseToExcelSearchBranches,GetClosingCommentStatusCanViewTaskAsync"Can see" is now one pure rule,
Core.Common.TaskVisibility.CanSee: project member, plus either "view others' tasks" or being the task's developer or tester. That is the same rule asCanViewTaskAsyncand the backlog grid.The comment box now shows the server's message when a comment is refused, instead of adding it to the list.
Not changed: the project-member flag Can comment is still not enforced (it never was). Enforcing it could block people who comment today, so it's left for a separate decision.
How it was tested
dotnet build src/Taskist.slnanddotnet test src/Taskist.slnpass: 442 tests, 5 new inTaskVisibilityTests.Checklist
dotnet build src/Taskist.slnanddotnet test src/Taskist.slnpasssql-scripts/03_locale.sql(Backlog.NotAuthorizedViewMsg,Backlog.BatchUpdate.Skipped)sql-scripts/02_defaults.sql(n/a)ViewBag/ViewData, no comments in.csfiles