mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-12 22:47:12 +03:00
Add ability to add manually choose who can submit chapters
This commit is contained in:
11
src/utils/permissions.ts
Normal file
11
src/utils/permissions.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { config } from "../config";
|
||||
import { Feature, HashedUserID } from "../types/user.model";
|
||||
import { hasFeature } from "./features";
|
||||
import { isUserVIP } from "./isUserVIP";
|
||||
import { getReputation } from "./reputation";
|
||||
|
||||
export async function canSubmitChapter(userID: HashedUserID): Promise<boolean> {
|
||||
return (await isUserVIP(userID))
|
||||
|| (await getReputation(userID)) > config.minReputationToSubmitChapter
|
||||
|| (await hasFeature(userID, Feature.ChapterSubmitter));
|
||||
}
|
||||
Reference in New Issue
Block a user