How to check which user/role are being targeted for impersonation?
At first how I use this package on my app was simple: only Super Admins are allowed to impersonate. However, now I need to allow Role X as well, but only to impersonate Role Y.
Any ideas on how to do that? I'm thinking to use a simple if-statement inside the `canImpersonate` User class' method to check wether the current user is Role X, but how can I check that the he/she wants to impersonate Role Y and not the other?
关闭于 2025-05-23 1 条评论