Skip to content

Add ConversationPartController with show endpoint and policy #1290

@begedin

Description

@begedin

Problem

See #1286 for an explanation of how a Message system works.

Once we have created a Message and it's associated Conversation, any side of the conversation can post a reply.

Each of these replies then creates a ConversationPart containing its contents.

Since we will be fetching ConversationPart records asynchronously, we need to have a show endpoint.

Subtasks

  • implement Policy.ConversationPart.show?
    • current_user is authorized if current_user.id == record.author_id
    • current_user is authorized if current_user.id == record.conversation.user_id
    • current_user is authorized if current_user.id == record.conversation.message.author_id
    • current_user is authorized if admin or higher on record.conversation.message.project
  • write tests for Policy.ConversationPart.show?
  • implement ConversationPartController :show endpoint
    • fetches by id
    • authorizes using policy
  • write tests for :show endpoint

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions