-
-
Notifications
You must be signed in to change notification settings - Fork 254
Add user() helper
#1768
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
Add user() helper
#1768
Conversation
📝 WalkthroughWalkthroughReplaces uses of auth()->user() with a new global user() helper across the codebase, switching many permission, visibility, timezone/language, and query-scoping calls to user() / user()?->. Adds user() in app/helpers.php. No public APIs or method signatures changed. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant UI as Filament UI / Blade
participant H as user() helper
participant P as Policies / Auth
participant S as Service / DB
U->>UI: Request page or trigger action
UI->>H: call user()
H-->>UI: returns User instance or null
UI->>P: evaluate can(permission, subject) with user()
P-->>UI: allowed / denied
alt allowed
UI->>S: perform operation using user() context
S-->>UI: operation result
UI-->>U: render success / data
else denied
UI-->>U: hide/disable UI or return 403
end
Pre-merge checks❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (17)
🚧 Files skipped from review as they are similar to previous changes (6)
🧰 Additional context used🧬 Code graph analysis (11)app/Filament/Admin/Resources/Servers/Pages/CreateServer.php (2)
app/helpers.php (1)
app/Filament/Server/Resources/Backups/BackupResource.php (3)
app/Extensions/Features/Schemas/GSLTokenSchema.php (3)
app/Filament/Server/Resources/Files/Pages/DownloadFiles.php (2)
app/Filament/Server/Pages/Startup.php (5)
app/Extensions/Features/Schemas/JavaVersionSchema.php (3)
app/Filament/Server/Resources/Files/Pages/EditFiles.php (1)
app/Filament/Server/Resources/Allocations/AllocationResource.php (2)
app/Filament/Server/Resources/Databases/DatabaseResource.php (3)
app/Filament/Server/Resources/Schedules/ScheduleResource.php (3)
🪛 PHPMD (2.15.0)app/Filament/Server/Resources/Backups/BackupResource.php309-309: Avoid unused parameters such as '$record'. (undefined) (UnusedFormalParameter) app/Filament/Server/Resources/Allocations/AllocationResource.php129-129: Avoid unused parameters such as '$record'. (undefined) (UnusedFormalParameter) 134-134: Avoid unused parameters such as '$record'. (undefined) (UnusedFormalParameter) app/Filament/Server/Resources/Databases/DatabaseResource.php216-216: Avoid unused parameters such as '$record'. (undefined) (UnusedFormalParameter) 226-226: Avoid unused parameters such as '$record'. (undefined) (UnusedFormalParameter) 231-231: Avoid unused parameters such as '$record'. (undefined) (UnusedFormalParameter) app/Filament/Server/Resources/Schedules/ScheduleResource.php77-77: Avoid unused parameters such as '$record'. (undefined) (UnusedFormalParameter) 82-82: Avoid unused parameters such as '$record'. (undefined) (UnusedFormalParameter) 🔇 Additional comments (10)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Supersedes #979