~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

What `public` means differs between the views and the authority

Open
Open chadtmiller.com opened this issue 0 comments

What happened

rbac.rs and the lexicons define public as "anyone signed in". But getGroup with no auth calls can_read(&[], ""), which is true for public, so a caller who is not signed in gets the profile and rules. listGroups, which takes no auth, shows the same, and /img serves meta images to anyone while the group is declared. Meanwhile Host::may with user = None gives nothing in a group's space (public_read is never set), so an unauthenticated read of the same meta records through the space methods is refused. A reader of the lexicon is misled, and the host's two paths disagree.

How to see it

Read against docs/fresh at 4636e6d, the code at: rbac.rs:13 (PUBLIC), rbac.rs:78; group_api.rs:217-221 (get_group), :374 (list_groups); authority.rs:149-151 (may); lexicons defs.json:726, access.json:44. Paths are under crates/group-host/src unless they say otherwise. Severity: low.

What you expected

Decide on one meaning. Given the declaration and unauthenticated listGroups, that is "anyone". Change the text in rbac.rs, defs.json and access.json to say so, and let may answer reads of a public space for user = None. Otherwise, gate the views on a caller.

Where

The host, as built from 4636e6d. Found while checking the docs against the code.