Implement RLS and security functions

Apply Row Level Security to orphaned_images and system_alerts tables. Create RLS policies for admin/moderator access. Replace system_health view with get_system_health() function.
This commit is contained in:
gpt-engineer-app[bot]
2025-11-07 01:02:58 +00:00
parent 6bc5343256
commit e747e1f881
6 changed files with 265 additions and 22 deletions

View File

@@ -5989,15 +5989,6 @@ export type Database = {
}
Relationships: []
}
system_health: {
Row: {
alerts_last_24h: number | null
checked_at: string | null
critical_alerts_count: number | null
orphaned_images_count: number | null
}
Relationships: []
}
}
Functions: {
anonymize_user_submissions: {
@@ -6221,6 +6212,15 @@ export type Database = {
updated_at: string
}[]
}
get_system_health: {
Args: never
Returns: {
alerts_last_24h: number
checked_at: string
critical_alerts_count: number
orphaned_images_count: number
}[]
}
get_user_management_permissions: {
Args: { _user_id: string }
Returns: Json