Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get user by the panel guard. #15387

Conversation

Abdelhammied
Copy link

@Abdelhammied Abdelhammied commented Jan 21, 2025

Add Getting user by the panel guard for different guards and assert the filament function exists for panel usage

Description

Add Getting user by the panel guard for different guards and assert the filament function exists for panel usage.
Because the code was written to get the default guard only, the added code can check if filament exists so if the import and export actions have been used alone or with filament both cases will be handled

Visual changes

image
image

Functional changes

  • Code style has been fixed by running the composer cs command.
  • Changes have been tested to not break existing functionality.
  • Documentation is up-to-date.

Add Getting user by the panel guard for different guard and assert the filament function exists for panels usage
add the fix in the download export handler
@danharrin
Copy link
Member

In version 4 there is customisation available for the auth guard, but I think this PR would introduce some unintended behaviour. Outside of a panel route, filament() will return the default panel, so if the user is using imports/exports outside of panels they would then have to be logged into the same guard as the default panel, otherwise it would not work. Thank you for the suggestion though.

@danharrin danharrin closed this Jan 22, 2025
@Abdelhammied
Copy link
Author

Abdelhammied commented Jan 22, 2025

So how can we use a different guard for the export and import actions, in panels,
Can be done through a different approach without using the filament function, should it be tried?

@danharrin
Copy link
Member

How can it be done without using the Filament function, and how would that improve what I described?

@Abdelhammied
Copy link
Author

Can you please check this new pr ?

#15404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants