mirror of
https://github.com/beilunyang/moemail.git
synced 2025-09-26 19:41:22 +08:00
fix: the duke can not be used as the default role
This commit is contained in:
@@ -21,7 +21,16 @@ const ROLE_DESCRIPTIONS: Record<Role, string> = {
|
||||
|
||||
const getDefaultRole = async (): Promise<Role> => {
|
||||
const defaultRole = await getRequestContext().env.SITE_CONFIG.get("DEFAULT_ROLE")
|
||||
return defaultRole === ROLES.KNIGHT ? ROLES.KNIGHT : ROLES.CIVILIAN
|
||||
|
||||
if (
|
||||
defaultRole === ROLES.DUKE ||
|
||||
defaultRole === ROLES.KNIGHT ||
|
||||
defaultRole === ROLES.CIVILIAN
|
||||
) {
|
||||
return defaultRole as Role
|
||||
}
|
||||
|
||||
return ROLES.CIVILIAN
|
||||
}
|
||||
|
||||
async function findOrCreateRole(db: Db, roleName: Role) {
|
||||
|
Reference in New Issue
Block a user