satom99

satom99

Candy - Resource authorization for Phoenix

Dead simple resource authorization with only a couple plugs. Inspired by canary.

Repository: GitHub - satom99/candy: Resource authorization for Phoenix · GitHub

Contributions are more than welcome, as always!

First Post!

hauleth

hauleth

  1. Why do you assume that there will be only one Repo in all applications running?
  2. Why such simple functionality (call function with and pattern match on arguments) require whole library for that? With licensing, version management, and all that cruft required for using external code?

Most Liked

satom99

satom99

I found myself copying this exact same code amongst multiple projects, so having it as a separate package made it handier :slight_smile:. I also figured I would share it so that others could have a look and possibly extract ideas they could extrapolate to their own set of authorization plugs.

As for the config, I work with a single Repo so that was fine for me. One could easily add a param to specify a repo per-plug call, or possibly have a get callback on the model/schema itself and go that way instead - but then again, this is where one could grab the published code and modify it as they see fit.

Where Next?

Popular in Announcing Top

Crowdhailer
Experimenting with this code. OK.try do user <- fetch_user(1) cart <- fetch_cart(1) order = checkout(cart, user) save_orde...
New
michalmuskala
Hello everybody. I have just released Jason - a new JSON library. You might be wondering, why do we need a new library? The primary foc...
New
josevalim
Yes, yet another parser combinator library! Most of the parser combinators in the ecosystem are either compile-time, often using AST tra...
159 19951 141
New
josevalim
EDIT: since Ecto 3.0 final version is out, this post was amended to use the final versions in the instructions below. Hi everyone, We a...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44778 311
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
brainlid
LangChain is short for Language Chain. An LLM, or Large Language Model, is the “Language” part. This library makes it easier for Elixir a...
New

Other popular topics Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement