test write access by unprivileged users to read-only resources#1399
Conversation
|
On commit cbf1b8d, here's the output of the unauthorized test: Note that we're skipping testing the authenticated, unauthorized user for all methods for endpoints like |
| # | ||
| # It's unclear what else would break if users couldn't see their own Silo. | ||
| has_permission(actor: AuthenticatedActor, "read", silo: Silo) | ||
| # TODO actor.silo is *not* a list, so `in` is incorrect here, but if you |
There was a problem hiding this comment.
I removed this comment and the one at L171 because this behavior is documented:
https://docs.osohq.com/rust/reference/polar/classes.html#options
What wasn't obvious to me from the documentation was whether x in y returns true if y was any Some value or only if it was Some(x). I've tested it, and it's only if y is Some(x) (which of course makes much more sense).
There was a problem hiding this comment.
Thanks, was not aware of that language feature. Makes sense, though still a bit non-obvious (to me, at least).
plotnick
left a comment
There was a problem hiding this comment.
Thanks as always for helping to ensure that authorization is working correctly and as intended.
In #1341 I suggested that the "unauthorized.rs" test could test the behavior of unprivileged users attempting to POST/PUT/DELETE things they're only supposed to be able to read. I'm trying that here.