Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 11, 2025

Authorization logic was comparing a User object with a string, causing type mismatch.

Changes

  • Fixed three authorization checks in PostController (edit(), update(), delete() methods)
  • Changed from $post->getAuthor() !== $user->getUsername() to $post->getAuthorId() !== $user->getId()
// Before: comparing User object with string
if (!$user->isAdmin() && !$user->isEditor() && $post->getAuthor() !== $user->getUsername())

// After: comparing IDs
if (!$user->isAdmin() && !$user->isEditor() && $post->getAuthorId() !== $user->getId())

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 11, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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

Co-authored-by: ljonesfl <1099983+ljonesfl@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP Address feedback on service architecture implementation Fix type mismatch in PostController authorization checks Nov 11, 2025
Copilot AI requested a review from ljonesfl November 11, 2025 03:15
@ljonesfl ljonesfl marked this pull request as ready for review November 11, 2025 03:22
@ljonesfl ljonesfl merged commit 332e8a7 into feature/service-architecture Nov 11, 2025
2 checks passed
@ljonesfl ljonesfl deleted the copilot/sub-pr-6-yet-again branch November 11, 2025 03: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