I was try to build a plug that check if a resorce.user_id is == to current_user_id but i can’t find a way to get the resource before the action get called
Well where does
resorce come from? Is it the session, a cookie, or a parameter, or…?
is like I want to show a post but before i allow to show the post or not i have to know if post.user_id equal current_user.id. i had found some people use Repo.one from the plug and send it down through plug.assigns but it is a good practice?
I would put this check and any other
Repo calls into the “context.”
I am a little bit confused can you give me a small example
I do it like this currently
Trying to mimic http://trailblazer.to/