Yeah, that’s how I do it. You can see that I in fact attach an atom to each set of routes. Like all these barcode routes and the :barcode_routes
atom.
Then in the Plug I retrieve that atom (representing thus that set of routes), and I check if the user has the right permissions for those routes.
Maybe there’s an easier way for you, but I just show you how I implemented it. This way, if you want to check something more than the permissions
property in the future, there are no restrictions and you can check other user attributes.