404labfr / laravel-impersonate

Laravel Impersonate is a plugin that allows you to authenticate as your users.
https://marceau.casals.fr
2k stars 202 forks source link

Impersonate Read only rights in production environment but edit rights in local environment #176

Open harry-fakir opened 1 year ago

harry-fakir commented 1 year ago

is it possible to have read only rights when impersonating a user in production environment but edit rights in local environment?

I am working on an APP where i would want edit rights in the local environment when impersonating a user for debugging purposes but don't want to errorsonly edit a users profile when in production - hence read only.

tonypartridger commented 1 year ago

It really depends what permissions package you are using.

I use spatie and you can just change the ‘edit’, ‘create’ etc and condition then on impersonation. If env is production and is impersonated edit, create and delete are ‘read’


From: harry-fakir @.> Sent: Thursday, February 2, 2023 9:08:09 PM To: 404labfr/laravel-impersonate @.> Cc: Subscribed @.***> Subject: [404labfr/laravel-impersonate] Impersonate Read only rights in production environment but edit rights in local environment (Issue #176)

is it possible to have read only rights when impersonating a user in production environment but edit rights in local environment?

I am working on an APP where i would want edit rights in the local environment when impersonating a user for debugging purposes but don't want to errorsonly edit a users profile when in production - hence read only.

— Reply to this email directly, view it on GitHubhttps://github.com/404labfr/laravel-impersonate/issues/176, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AYSFUJPJHIGKOAVXSMMDHG3WVQO3TANCNFSM6AAAAAAUPQK754. You are receiving this because you are subscribed to this thread.Message ID: @.***>

harry-fakir commented 1 year ago

Thanks! I am using spatie/laravel-permission :)