Owner_id if uploaded with anon, service_key or dashboard_user #751
RomanRC99
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was running some analysis on users and the number of files they uploaded and stumbled upon interesting findings:
when maping user email and count of files, i get two things into the "no email" category:
`SELECT
id,
bucket_id,
name,
owner,
owner_id,
created_at
FROM storage.objects
WHERE owner_id IS NULL
UNION ALL
SELECT
id,
bucket_id,
name,
owner,
owner_id,
created_at
FROM storage.objects so
WHERE so.owner_id IS NOT NULL
AND NOT EXISTS (
SELECT 1 FROM auth.users au
WHERE au.id::text = so.owner_id
);`
Is there a possibility how to distinguish files uploaded by dashboard user, service role key, or anon user? I was thinking about possible implementation into the owner_id field, but this would break the FK rules, since there are no users for those cases in the auth.users table...so probably some other solution is needed...
Beta Was this translation helpful? Give feedback.
All reactions