Align missing-episode searches and permit reviewed profile overrides
This commit is contained in:
@@ -4,6 +4,7 @@ export const FEATURES = [
|
||||
{ key: 'new_requests', label: 'New Requests', description: 'Search for movies and TV shows and submit new requests.' },
|
||||
{ key: 'issues', label: 'Issues', description: 'Report problems, follow up on issues and use available repair tools.' },
|
||||
{ key: 'invites', label: 'Invites', description: 'Create and manage invitations within the existing invite limits.' },
|
||||
{ key: 'ignore_profile_limits', label: 'Ignore profile limits', description: 'Allow explicit manual downloads outside quality, size, language or custom-format limits. Automatic searches keep the assigned profile.' },
|
||||
] as const
|
||||
export type Feature = typeof FEATURES[number]['key']
|
||||
export type FeatureAccess = Record<Feature, boolean>
|
||||
@@ -19,5 +20,5 @@ export function canAccess(user: { role?: string; features?: Partial<FeatureAcces
|
||||
if (!feature) return true
|
||||
if (!user) return false
|
||||
if (user.role === 'admin') return true
|
||||
return user.features?.[feature] ?? (feature === 'invites' ? Boolean(user.invite_management_enabled) : true)
|
||||
return user.features?.[feature] ?? (feature === 'invites' ? Boolean(user.invite_management_enabled) : feature !== 'ignore_profile_limits')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user