Re:Show HN: A Go Library for Better Access Control
by eternalban on Saturday March 18, 2017 @08:50PM
(#13904442)
> think about them in terms of which actions are available to a user at each endpoint
It's called the Capability Model: https://en.wikipedia.org/wiki/Capability-based_security
For anyone struggling with permissions, it might be easier to think about them in terms of which actions are available to a user at each endpoint, something along the lines of this with HATEOAS and filtering links:
https://opencredo.com/designing-rest-api-fine-grained-resour...
A few things that ACLs can potentially break:
* PUT/PATCH requests: every relationship (and every attribute if using field-level security) of every resource needs permissions checks
* Database consistency: if logic is too complex to put in triggers, then permissions table can get out of sync with roles
* Russian doll caching (and caching in general): views now vary by user based on what subviews are visible
There are so many ramifications with permissions systems that it's worth implementing them early on in your project if you know you'll need them, or approaching them from a different angle like how Firebase rules are implemented declaratively and inherited per-resource.