(ctx: Context, authorId: string)
| 146 | } |
| 147 | |
| 148 | export 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 | |
| 159 | export function assertIsUserInServer(ctx: Context, targetServerId: string) { |
| 160 | if (isSuperUser(ctx)) return; |
nothing calls this directly
no test coverage detected