Allow requester (collaborator) to add PUBLIC comments to own tickets; fix 'Autor não possui permissão'
This commit is contained in:
parent
8292abee88
commit
d1871ba232
1 changed files with 3 additions and 7 deletions
|
|
@ -717,13 +717,9 @@ export const addComment = mutation({
|
|||
}
|
||||
|
||||
if (ticketDoc.requesterId === args.authorId) {
|
||||
// requester commenting: managers restricted to PUBLIC (handled above);
|
||||
// internal staff require staff permission
|
||||
if (STAFF_ROLES.has(normalizedRole)) {
|
||||
await requireTicketStaff(ctx, args.authorId, ticketDoc)
|
||||
} else {
|
||||
throw new ConvexError("Autor não possui permissão para comentar")
|
||||
}
|
||||
// O próprio solicitante pode comentar seu ticket.
|
||||
// Comentários internos já são bloqueados acima para quem não é STAFF.
|
||||
// Portanto, nada a fazer aqui.
|
||||
} else {
|
||||
await requireTicketStaff(ctx, args.authorId, ticketDoc)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue