Impersonating Troubleshooters can now impersonate users and groups#7465
Impersonating Troubleshooters can now impersonate users and groups#7465labkey-adam wants to merge 11 commits intodevelopfrom
Conversation
| .filter(Role::isAssignable) | ||
| .filter(role -> role.isApplicable(policy, c)) | ||
| .filter(role -> !role.isPrivileged() || canImpersonatePrivilegedRoles); | ||
| .filter(role -> !role.isPrivileged() || canImpersonatePrivilegedRoles) |
There was a problem hiding this comment.
Fix up mismatch between container used for c.hasPermission(ImpersonationPermission) and role.isApplicable(c)
There was a problem hiding this comment.
After further investigation, switching this to always pass in and check project (or root if null). AuthFilter checks perms based on the project stashed in the factory that's in session; it has no idea what the current folder is. That means we can impersonate roles only if they're applicable at the root or project level (never those only applicable in a folder). But no one has complained...
There was a problem hiding this comment.
Great, maybe add a comment to memorialize the thought?
labkey-jeckels
left a comment
There was a problem hiding this comment.
One suggestion and two questions from automated code review tool. See what you think.
Rationale
https://github.com/LabKey/internal-issues/issues/837
Changes
ImpersonatePermissionclass is now used instead ofAdminPermissionas the primary check. Action-level and manager permission checking has been removed; all permission checking is performed by choke points in each impersonation context for simplicity and consistency.GroupImpersonationContext. This matches the behavior of when they impersonate a privileged user.AbstractRootContainerRole.isAvailableEverywhere()-->isApplicableOutsideRoot()CanImpersonatePrivilegedSiteRolesPermission-->ImpersonatePrivilegedSiteRolesPermissionwild-cardorwild card-->wildcard