Skip to content

Allow admins to delete any ImportTask#1510

Merged
JasonWildMe merged 3 commits intomainfrom
fix-admin-delete-import-task
Apr 10, 2026
Merged

Allow admins to delete any ImportTask#1510
JasonWildMe merged 3 commits intomainfrom
fix-admin-delete-import-task

Conversation

@JasonWildMe
Copy link
Copy Markdown
Collaborator

Summary

  • Admins were getting "user does not have privileges to delete task" when deleting an ImportTask they didn't create
  • canUserAccessImportTask has no admin check — only checks task creator and collaboration records
  • Add user.isAdmin() bypass before the access check

Test plan

  • Log in as admin, delete an ImportTask created by another user
  • Verify non-admin non-creator users are still denied

🤖 Generated with Claude Code

canUserAccessImportTask only checks task creator and collaboration
records — it has no admin check. Admins who didn't create the task
and have no collaboration with the encounter owners were denied.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.25%. Comparing base (0a0753e) to head (5d674b9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1510   +/-   ##
=======================================
  Coverage   53.25%   53.25%           
=======================================
  Files         274      274           
  Lines        9818     9818           
  Branches     2991     2978   -13     
=======================================
  Hits         5229     5229           
  Misses       4339     4339           
  Partials      250      250           
Flag Coverage Δ
backend 53.25% <ø> (ø)
frontend 53.25% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JasonWildMe JasonWildMe requested a review from naknomum March 25, 2026 05:22
@JasonWildMe JasonWildMe self-assigned this Mar 25, 2026
@JasonWildMe JasonWildMe marked this pull request as ready for review March 25, 2026 05:22
Copy link
Copy Markdown
Member

@naknomum naknomum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@JasonWildMe JasonWildMe merged commit 55a2dc8 into main Apr 10, 2026
2 checks passed
@JasonWildMe JasonWildMe deleted the fix-admin-delete-import-task branch April 10, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants