MCPcopy Create free account
hub / github.com/AnswerOverflow/AnswerOverflow / assertCanEditMessage

Function assertCanEditMessage

packages/api/src/utils/permissions.ts:148–157  ·  view source on GitHub ↗
(ctx: Context, authorId: string)

Source from the content-addressed store, hash-verified

146}
147
148export function assertCanEditMessage(ctx: Context, authorId: string) {
149 if (isSuperUser(ctx)) return;
150 if (ctx.discordAccount?.id !== authorId) {
151 return new TRPCError({
152 code: 'FORBIDDEN',
153 message: MISSING_PERMISSIONS_TO_EDIT_SERVER_MESSAGE,
154 });
155 }
156 return;
157}
158
159export function assertIsUserInServer(ctx: Context, targetServerId: string) {
160 if (isSuperUser(ctx)) return;

Callers

nothing calls this directly

Calls 1

isSuperUserFunction · 0.85

Tested by

no test coverage detected