Can somebody explain this?
Can somebody explain this?
This goes hand in hand with abstracting all authorization checks to a single gateway/middleware layer that each call inherits, rather than a spot check per call or a group of checks for different groups of calls.
(This is in addition to what 'lvh and 'tptacek have said already.)
If the API is meant to be consumed by machines then it's unlikely that CSRF would be a threat.
CSRF controls are more likely to be provided out of the box by a framework. Authorization controls are often tightly coupled to the business domain and are less likely to be usable out of the box.
If you need to support a scenario where administrators perform tasks on behalf of other users, then I would suggest evaluating whether a sudo-like mechanism could be viable solution.
Preventing flexibility at the URL level rather than performing proper authentication strikes me as a poor decision.
You're just tying yourself down for no good reason.