Skip to content

Instantly share code, notes, and snippets.

@francium-lupe
Created June 28, 2023 18:26
Show Gist options
  • Save francium-lupe/653e0672554ae358ceec794a25cf78a5 to your computer and use it in GitHub Desktop.
Save francium-lupe/653e0672554ae358ceec794a25cf78a5 to your computer and use it in GitHub Desktop.
The core components of authorization
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