3 ms·
That works as long as you have no distinctions between objects of a type. _Which_ calendar can they edit? All of them? Putting all the repos you can access int
by hirsin 1y ago
That works as long as you have no distinctions between objects of a type. _Which_ calendar can they edit? All of them?
Putting all the repos you can access into a token is a request we get sometimes. It would be... Difficult.
- kgeist 1y agoI agree it doesn't work for all cases. In our case, some services can have complex, service-specific access control logic that's hard to express declaratively in a token, so we also have to make some checks by consulting the DB. I don't think that's usually a problem (performance-wise) because we already need to contact the DB anyway - to retrieve the entity to work with (and that has, say, an OwnerID property). The access token helps reduce DB load by skipping general checks ("can the user access calendars in principle?"), and for users who can, we then consult the DB additionally, if the service requires it ("is the user actually the owner of this calendar?" or any other additional access logic). The general case "can the user access calendars in principle?" also allows to hide menu items / return 403 in the UI immediately with zero DB or cache cost.