laravel / telescope

An elegant debug assistant for the Laravel framework.
https://laravel.com/docs/telescope
MIT License
4.88k stars 583 forks source link

Gate filter on user id #117

Closed fridzema closed 6 years ago

fridzema commented 6 years ago

I think it is more convenient to check on user id in in the viewTelescope Gate.

Reasons: User email can easily be changed and breaks access to telescope. Performance.

backstageel commented 6 years ago

You can easily change the function yourself:

protected function gate()
    {
        Gate::define('viewTelescope', function ($user) {
            return in_array($user->id, [1,2]);
        });
    }
fridzema commented 6 years ago

@backstageel thanks, i have already done this for myself but i think this way is better as default.

simonj commented 6 years ago

Laravel Spark use Email aswell

vesper8 commented 6 years ago

Depending on the email is much safer. What if you're testing a feature that lets you delete your user so you can re-register it.. you might do this on your own user in a production environment, then you'd have to change the hardcoded gate

themsaid commented 6 years ago

No plans to support this at the moment.