Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: Add write checks to channels #775

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

filipecabaco
Copy link
Member

Add write permissions checks for the Authorization modules.

It checks if a given user can write by trying to updating a column in the channels table. After done, reverts the change within the same transaction.

Also took the time to refactor a bit the code to use some helper functions previously built in the Repo module to avoid bare sql code and have a more structured approach.

Copy link

vercel bot commented Jan 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
realtime-demo ⬜️ Ignored (Inspect) Visit Preview Jan 11, 2024 5:13pm

@filipecabaco filipecabaco force-pushed the fix/write-permission-check-with-rls branch from 683070d to da5f0ba Compare January 9, 2024 17:47
@filipecabaco filipecabaco requested review from chasers, abc3, w3b6x9 and a team January 9, 2024 18:02
Copy link

@josevalim josevalim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @filipecabaco! 👋 I have dropped two comments/questions. :)

@filipecabaco filipecabaco force-pushed the fix/write-permission-check-with-rls branch from 65f58f4 to c9abe69 Compare January 10, 2024 14:40
Add write permissions checks for the Authorization modules.

It checks if a given user can write by trying to updating a column in the channels table. After done, reverts the change within the same transaction.

Also took the time to refactor a bit the code to use some helper functions previously built in the Repo module to avoid bare sql code and have a more structured approach.
@filipecabaco filipecabaco force-pushed the fix/write-permission-check-with-rls branch from 99f2555 to 576dc4e Compare January 11, 2024 17:13
@filipecabaco filipecabaco merged commit 7f3aa93 into main Jan 11, 2024
3 checks passed
@filipecabaco filipecabaco deleted the fix/write-permission-check-with-rls branch January 11, 2024 17:23
@kiwicopple
Copy link
Member

🎉 This PR is included in version 2.25.56 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants