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

Filament Support Panel #778

Merged
merged 23 commits into from
Nov 6, 2024
Merged

Filament Support Panel #778

merged 23 commits into from
Nov 6, 2024

Conversation

MathewEm
Copy link
Collaborator

@MathewEm MathewEm commented Oct 9, 2024

Implementation of a basic FilamentPHP Support Panel.
Features:

  • Support panel application module not strongly coupled to core application
  • Authentication policy imported from application
  • Ability for support staff to view list of users and edit their roles

Copy link

✔️ All Checks Passed!

🛡️ 0 Security Vulnerabilities
🚀 0 Performance Issues
🐛 0 Reliability Issues

You may view the full report here.

Copy link

✔️ All Checks Passed!

🛡️ 0 Security Vulnerabilities
🚀 0 Performance Issues
🐛 0 Reliability Issues

You may view the full report here.

Copy link

✔️ All Checks Passed!

🛡️ 0 Security Vulnerabilities
🚀 0 Performance Issues
🐛 0 Reliability Issues

You may view the full report here.

Copy link
Member

@vincentauger vincentauger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - please address the changes suggested.

*/
public function canAccessPanel(Panel $panel): bool
{
return $this->hasRole('admin');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, we should use permissions here instead, like 'view_librarium' and add this new permission to the author role in the role and permission seeder.

@@ -16,7 +16,7 @@ class UserPolicy
*/
public function viewAny(User $user)
{
return false;
return $user->hasRole('admin');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be view_all_users

@@ -49,7 +49,7 @@ public function create(User $user)
public function update(User $user, User $model)
{
// a user can update their own profile
return $user->id === $model->id;
return $user->id === $model->id or $user->hasRole('admin');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use permission and split in two lines

if($user->can('update_all_users') return true
...

->default()
->id('librarium')
->path('librarium')
->login()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's implement our own login page here, use the base filament page and copy it in App\Filament\Pages\Auth and refactor so that it uses the same throttling values as our main login flow.

Copy link

⚠️ 1 Checks Failed!

🛡️ 1 Security Vulnerabilities
🚀 0 Performance Issues
🐛 0 Reliability Issues

You may view the full report here.

@vincentauger vincentauger changed the base branch from main to bump-20241011 November 5, 2024 21:39
@vincentauger vincentauger changed the base branch from bump-20241011 to main November 5, 2024 21:39
@@ -47,6 +47,8 @@ public function run()
Permission::findOrCreate('view_telescope'),
Permission::findOrCreate('view_horizon'),
Permission::findOrCreate('view_pulse'),
Permission::findOrCreate('view_any_user'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should just be view_admin_panel to give access to the filament admin panel, the user view and user update should be based on the user policy.

Copy link

✔️ All Checks Passed!

🛡️ 0 Security Vulnerabilities
🚀 0 Performance Issues
🐛 0 Reliability Issues

You may view the full report here.

Copy link

✔️ All Checks Passed!

🛡️ 0 Security Vulnerabilities
🚀 0 Performance Issues
🐛 0 Reliability Issues

You may view the full report here.

@vincentauger vincentauger changed the base branch from main to bump-20240927 November 6, 2024 15:49
@vincentauger vincentauger changed the base branch from bump-20240927 to main November 6, 2024 15:49
Copy link

✔️ All Checks Passed!

🛡️ 0 Security Vulnerabilities
🚀 0 Performance Issues
🐛 0 Reliability Issues

You may view the full report here.

Copy link

✔️ All Checks Passed!

🛡️ 0 Security Vulnerabilities
🚀 0 Performance Issues
🐛 0 Reliability Issues

You may view the full report here.

Copy link

✔️ All Checks Passed!

🛡️ 0 Security Vulnerabilities
🚀 0 Performance Issues
🐛 0 Reliability Issues

You may view the full report here.

vincentauger
vincentauger previously approved these changes Nov 6, 2024
Copy link

✔️ All Checks Passed!

🛡️ 0 Security Vulnerabilities
🚀 0 Performance Issues
🐛 0 Reliability Issues

You may view the full report here.

Copy link

✔️ All Checks Passed!

🛡️ 0 Security Vulnerabilities
🚀 0 Performance Issues
🐛 0 Reliability Issues

You may view the full report here.

@vincentauger vincentauger merged commit 94a72e9 into main Nov 6, 2024
4 checks passed
@vincentauger vincentauger deleted the filament branch November 6, 2024 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants