Join Discord
Communities
Powered by
How can I set the policy to grant insertion rights...
# help
n
nxx
01/20/2022, 1:46 PM
How can I set the policy to grant insertion rights only to designated users?
s
silentworks
01/20/2022, 2:19 PM
You can do this by creating a function and use that inside of your policy. It's probably easier to add a role to a user and write the policy based on that, you can see an example in my project here The postgres function
https://github.com/silentworks/waiting-list/blob/main/migrations/00003-create_is_admin_function.cjs
The policy using the function
https://github.com/silentworks/waiting-list/blob/main/migrations/00004-create_rls_policy_profiles.cjs
n
nxx
01/20/2022, 2:32 PM
Thank you 🙂
Previous
Next