Skip to content

Commit

Permalink
Appは管理者/モデレータ権限を使えないように
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Dec 26, 2023
1 parent 59b8629 commit 7019f26
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/server/api/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ export default async (endpoint: string, user: IUser | null | undefined, app: IAp
});
}

if (app && ep.meta.requireAdmin) {
throw new ApiError(accessDenied, { reason: 'Apps cannot use admin privileges.' });
}

if (app && ep.meta.requireModerator) {
throw new ApiError(accessDenied, { reason: 'Apps cannot use moderator privileges.' });
}

if (ep.meta.limit) {
// Rate limit
await limiter(ep, user, ctx?.ip).catch(e => {
Expand Down

0 comments on commit 7019f26

Please sign in to comment.