Created
June 28, 2023 18:26
-
-
Save francium-lupe/653e0672554ae358ceec794a25cf78a5 to your computer and use it in GitHub Desktop.
The core components of authorization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def update_post(user, post) | |
if not user.admin? | |
raise Forbidden, "you must be an admin to update this post" | |
end | |
... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment