Skip to content

Implement Public Blog Sharing with Restricted Actions for Unauthorized Users #307

Description

@Udhaykrishn

Enhancement: Public Blog Sharing with Restricted Actions for Unauthorized Users

Description
Implement support for publicly viewable blog posts with strict access control: anyone can view public blogs, but only authorized users can like or comment.

Requirements

  • Blog posts can be publicly accessible via a shareable link.
  • Unauthorized users (not logged in):
    • Can view public blogs.
    • Cannot like or comment.
    • See disabled or restricted Like and Comment buttons.
    • Receive a prompt/modal saying "Please log in to like or comment on this post" if they try to interact.
    • May be redirected to the login page as needed.
    • See clear messages if the blog is deleted or blocked.

User Flow & Validation

  • When accessing a public blog:
    • The blog content is fully visible.
    • Like and Comment UI components are visible but require login for interaction.
  • If an unauthorized user tries to:
    • Like or Comment: show a login prompt/message.
  • If the blog is:
    • Blocked: Show message “This blog is currently unavailable.”
    • Deleted: Show message “This blog no longer exists or has been removed.”

Acceptance Criteria

  • Anyone can view public blog content via a shareable URL.
  • Unauthorized users:
    • Cannot perform like or comment actions without logging in.
    • Are prompted to log in when attempting to like or comment.
  • Authorized users can interact as expected based on permissions.
  • Real-time user feedback (toast/modal/message) is shown when:
    • A blog is deleted or blocked.
    • A non-logged-in user tries to like/comment.

Code Quality Guidelines

  • Write clean, well-structured, and modular code.
  • Reuse validation logic where possible.
  • Follow existing coding patterns and project structure.

Follow-up
If you have any questions or need clarification, comment below or open a discussion before starting development.


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend requiredenhancementNew feature or requestfrontendThe feature is related to frontend developmentsecurityMost important, since this is a security vulnerability.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions