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) {
|
if (ticketDoc.requesterId === args.authorId) {
|
||||||
// requester commenting: managers restricted to PUBLIC (handled above);
|
// O próprio solicitante pode comentar seu ticket.
|
||||||
// internal staff require staff permission
|
// Comentários internos já são bloqueados acima para quem não é STAFF.
|
||||||
if (STAFF_ROLES.has(normalizedRole)) {
|
// Portanto, nada a fazer aqui.
|
||||||
await requireTicketStaff(ctx, args.authorId, ticketDoc)
|
|
||||||
} else {
|
|
||||||
throw new ConvexError("Autor não possui permissão para comentar")
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
await requireTicketStaff(ctx, args.authorId, ticketDoc)
|
await requireTicketStaff(ctx, args.authorId, ticketDoc)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue