mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 09:51:13 -05:00
Fix: Correct RLS policies and function security
This commit is contained in:
@@ -91,6 +91,18 @@ serve(async (req) => {
|
||||
try {
|
||||
console.log(`Processing item ${item.id} of type ${item.item_type}`);
|
||||
|
||||
// Set user context for versioning trigger
|
||||
// This allows auto_create_entity_version() to capture the submitter
|
||||
const { error: setConfigError } = await supabase.rpc('set_config_value', {
|
||||
setting_name: 'app.current_user_id',
|
||||
setting_value: submitterId,
|
||||
is_local: false
|
||||
});
|
||||
|
||||
if (setConfigError) {
|
||||
console.error('Failed to set user context:', setConfigError);
|
||||
}
|
||||
|
||||
// Resolve dependencies in item data
|
||||
const resolvedData = resolveDependencies(item.item_data, dependencyMap);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user