Skip to content

Conversation

@rmartinoscar
Copy link
Member

They need to match RolePermissionModels since #1892

case ApiKey = 'apiKey';
case DatabaseHost = 'databaseHost';
case Database = 'database';
case Egg = 'egg';
case Mount = 'mount';
case Node = 'node';
case Role = 'role';
case Server = 'server';
case User = 'user';
case Webhook = 'webhook';

@coderabbitai
Copy link

coderabbitai bot commented Nov 27, 2025

📝 Walkthrough

Walkthrough

Updated the $modelName property casing in two policy classes to use camelCase format. ApiKeyPolicy's modelName changed from 'apikey' to 'apiKey', and DatabaseHostPolicy's changed from 'databasehost' to 'databaseHost'.

Changes

Cohort / File(s) Summary
Policy model name casing updates
app/Policies/ApiKeyPolicy.php, app/Policies/DatabaseHostPolicy.php
Updated $modelName property values from snake_case to camelCase for consistent identifier casing across policy classes

Possibly related PRs

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: fixing case sensitivity in policy model names, which matches the changeset that updates modelName values in ApiKeyPolicy and DatabaseHostPolicy.
Description check ✅ Passed The description is related to the changeset, explaining that the model names need to match RolePermissionModels as introduced in #1892, which provides context for why the casing changes are necessary.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d0af45a and e2b6db2.

📒 Files selected for processing (2)
  • app/Policies/ApiKeyPolicy.php (1 hunks)
  • app/Policies/DatabaseHostPolicy.php (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-06T10:11:54.301Z
Learnt from: Boy132
Repo: pelican-dev/panel PR: 1866
File: app/Policies/PluginPolicy.php:7-7
Timestamp: 2025-11-06T10:11:54.301Z
Learning: In the codebase, the `DefaultPolicies` trait is located in the `App\Policies` namespace (file: app/Policies/DefaultPolicies.php). Policy classes in the same namespace can use this trait without requiring an import statement.

Applied to files:

  • app/Policies/ApiKeyPolicy.php
🔇 Additional comments (2)
app/Policies/DatabaseHostPolicy.php (1)

12-12: Casing verified and correct.

The 'databaseHost' value in DatabaseHostPolicy.php (line 12) matches the exact casing in the RolePermissionModels enum (case DatabaseHost = 'databaseHost'). The change aligns with the PR objective and is ready to merge.

app/Policies/ApiKeyPolicy.php (1)

9-9: Casing verified and aligns with RolePermissionModels enum.

The change from 'apikey' to 'apiKey' is correct. The RolePermissionModels enum defines case ApiKey = 'apiKey' (line 7), and this change now matches that exact value. No other policy files define their own $modelName property—they inherit from the DefaultPolicies trait—so no additional updates are needed.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rmartinoscar rmartinoscar merged commit 97f5a0f into main Nov 27, 2025
25 checks passed
@rmartinoscar rmartinoscar deleted the fix/policiesModelname branch November 27, 2025 16:51
@github-actions github-actions bot locked and limited conversation to collaborators Nov 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants