Commit e5e910b
committed
fix(webapp): gate the impersonate route on canSuper, not the admin column
Opting out of the admin layout also opted out of its requireSuper check, leaving
this the only admin entry point gated on the raw User.admin column. canSuper()
equals that column in the OSS fallback, but an RBAC plugin is free to be
stricter.
The ability is now built explicitly for the real admin's id and canSuper() is
checked directly. dashboardLoader can't be used: it resolves its subject with
getUserId, which is the impersonated id while impersonating — the bug this route
exists to fix.1 parent 7be4c3b commit e5e910b
1 file changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
49 | 61 | | |
50 | 62 | | |
51 | 63 | | |
| |||
0 commit comments