Coder Social home page Coder Social logo

Comments (9)

tanthammar avatar tanthammar commented on May 29, 2024 1

@MACscr
I have different fields, table columns, views, actions and more, based on the user role. Want to impersonate, to give support to customers. To make sure I see - what they see.

from filament-impersonate.

jszobody avatar jszobody commented on May 29, 2024

Hmm, give me a bit to spin up a fresh Filament v2 app. TBH I haven't even done that yet. I wrote this for v1, then received a PR request to make it v2 compatible, and haven't actually tried it out myself. Will do so here in a bit...

from filament-impersonate.

jszobody avatar jszobody commented on May 29, 2024

I just tagged v2.1, can you upgrade and let me know if you still have any issues? It's working well for me now with these latest fixes.

from filament-impersonate.

tanthammar avatar tanthammar commented on May 29, 2024

@jszobody
I installed v2.1, thankyou :)
But Impersonation doesn't work.
I can't access the Filament admin panel.
I can access the rest of the site, as a logged in user, but when I try to access /admin/ I get the login form.

I added this to the user model:

class User extends Authenticatable implements FilamentUser
{
    use HasApiTokens, HasFactory, Notifiable, UserHasTeams, HasRoles;

    public function canAccessFilament(): bool
    {
        return true;
    }

    public function canImpersonate(): bool
    {
        return true;
    }

    public function canBeImpersonated(): bool
    {
        return true;
    }

from filament-impersonate.

jszobody avatar jszobody commented on May 29, 2024

Hmm, I was able to impersonate just fine with my fresh Filament v2 app.

It's worth pointing out though that the purpose of this package is for you (an admin) to impersonate a regular user in your "regular" app. It wasn't meant for you to impersonate another admin and use Filament itself as that other admin.

Does that make sense?

When you click the impersonation icon for one of your users, you should be redirected to your app homepage, and be able to navigate that as the impersonated user. In my case it's just a vanilla Jetstream app that I setup for testing.

from filament-impersonate.

jszobody avatar jszobody commented on May 29, 2024

Have you customized the Filament auth guard by chance?

config('filament.auth.guard')

from filament-impersonate.

tanthammar avatar tanthammar commented on May 29, 2024

The auth guard is default.
This is a fresh Laravel Breeze application, where I want all users to access the admin panel.

from filament-impersonate.

MACscr avatar MACscr commented on May 29, 2024

I assume your goal with the impersonate package then is to be able to test out their roles/permissions or whatever you set for the admin panel?

from filament-impersonate.

tanthammar avatar tanthammar commented on May 29, 2024

@jszobody Thank you for assisting me via Discord!
Enabling the AuthenticateSession middleware did the trick.
For other Breeze users :)

from filament-impersonate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.