Comment explaining the quota trigger GRANT

pull/13550/head
Javier Torres 7 years ago
parent 5a970386d2
commit 29117d32b0

@ -197,6 +197,11 @@ module Carto
"ALTER ROLE \"#{db_role}\" SET search_path TO #{user.db_service.build_search_path}"
]
# This is GRANTED to the organizational role for organization users, and the PUBLIC users for non-orgs
# We do not want to grant the organization role to the Api Keys, since that also opens access to the analysis
# catalog and tablemetadata. To be more consistent, we should probably GRANT this to the organization public
# user instead, but that has the downside of leaking quotas to the public.
# This works for now, but if you are adding new permissions, please reconsider this decision.
if user.organization_user?
queries << "GRANT ALL ON FUNCTION \"#{user.database_schema}\"._CDB_UserQuotaInBytes() TO \"#{db_role}\""
end

Loading…
Cancel
Save