[BISON-19] Add impersonation functionality for users and update permissions#22
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces user impersonation functionality to allow authorized administrators to impersonate other users through the admin panel. The implementation integrates a third-party Filament package and adds proper permission controls.
- Added
stechstudio/filament-impersonatepackage dependency for impersonation capabilities - Implemented permission-based access control with
canImpersonateandcanBeImpersonatedmethods in the User model - Updated the EditUser admin page to include an "Impersonate User" action in a grouped button interface
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| config/roles_permissions.php | Added admin.users.impersonate permission to SUPER_ADMIN role |
| composer.json | Added stechstudio/filament-impersonate package dependency |
| app/Models/User.php | Implemented impersonation permission methods with role-based access control |
| app/Filament/Resources/Users/Pages/EditUser.php | Added impersonate action to EditUser page header with grouped button UI |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
MlKilderkin
approved these changes
Aug 20, 2025
…t avatar URL generation for consistency
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces user impersonation functionality to the application, allowing certain users to impersonate others through the admin panel. The implementation includes UI changes, permission checks, and the integration of a third-party package to support this feature.
User Impersonation Feature:
stechstudio/filament-impersonatepackage tocomposer.jsonto provide impersonation capabilities.EditUserpage to include an "Impersonate User" action in the header actions, grouped under an "Actions" button, using the new package.Permissions and Role Management:
admin.users.impersonatepermission to theconfig/roles_permissions.phpconfiguration.canImpersonateandcanBeImpersonatedmethods in theUsermodel to restrict impersonation so that only users with theSUPER_ADMINrole or theadmin.users.impersonatepermission can impersonate, and to preventSUPER_ADMINusers from being impersonated.Jira:
https://moderntribe.atlassian.net/browse/BISON-19