Skip to content

Impersonating Troubleshooters can now impersonate users and groups#7488

Open
labkey-adam wants to merge 2 commits intorelease26.3-SNAPSHOTfrom
26.3_fb_impersonation
Open

Impersonating Troubleshooters can now impersonate users and groups#7488
labkey-adam wants to merge 2 commits intorelease26.3-SNAPSHOTfrom
26.3_fb_impersonation

Conversation

@labkey-adam
Copy link
Contributor

@labkey-adam labkey-adam commented Mar 11, 2026

Rationale

Backport of #7465

@labkey-jeckels labkey-jeckels changed the title Impersonating Troubleshooters can now impersonate users and groups (#… Impersonating Troubleshooters can now impersonate users and groups Mar 11, 2026
@labkey-jeckels
Copy link
Contributor

The PR in develop is causing a crawler failure when it hits /home/user-impersonateUser.view with a GET. It's because ImpersonateApiAction.checkPermissions() doesn't always call super.checkPermissions(). That eventually calls PermissionCheckableAction._checkActionPermissions() which also checks the HTTP method. Without rejecting GETs via BadRequestException, we later hit the assertion in MutatingApiAction.handleGet().

https://teamcity.labkey.org/buildConfiguration/bt401/3887325?buildTab=tests&expandedTest=build%3A%28id%3A3887325%29%2Cid%3A2000000400&logFilter=debug&logView=flowAware

Simple repro is to hit /home/user-impersonateUser.view with a GET in your browser. We want to see:

{
  "exception" : "Method Not Allowed: GET",
  "success" : false
}

instead of:

{
  "exception" : "Should not get here",
  "success" : false
}

I propose we fix in this PR and let it propagate into develop. Maybe by refactoring the method check in PermissionCheckableAction into a separate method that can be called in ImpersonateApiAction.checkPermissions()?

@labkey-adam @labkey-danield

@labkey-adam
Copy link
Contributor Author

Yep, I'm aware and have a local fix

@labkey-adam
Copy link
Contributor Author

labkey-adam commented Mar 12, 2026

The checkPermissions() override in ImpersonateApiAction was an early experiment that should have been removed when I changed the subclasses to @RequiresNoPermission, delegating permission checks to the impersonation contexts

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.

2 participants