chadtmiller.com/group-host
atmosphere group host
0
0
A group's profile, images and rules are changed by those who may configure it
Merged Approved
This adds updateProfile, uploadImage, putRule and deleteRule in group_config.rs. Each is gated on group.configure, checked against the group's permissions record. The routes are wired, the lexicons for these methods already exist, and docs/design/groups.md and the README plan are updated. I read the whole diff but did not run the checks.
- Permissions:
configurersigns the caller in, checks the group exists, then checks the action. The tests cover a member, a stranger and no auth. - Profile: the semantics match the body: join policy,
createdAtand site are kept, and images are kept unlessnullis given. Topics and languages are bounded as described. - Rules: edits keep their key, place and creation time, and a new rule goes last.
ordermoves a rule.
Two small things, neither blocking:
putreads the record and then picks Create or Update. Two concurrent calls for the same key could both choose Create, and the second would fail with whatever errorspace_writegives. That is rare for an admin-only method.putRuletakes a caller-suppliedrkeyas given. I assumedspace_writeor the record layer rejects an invalid key, and I did not check that. A one-line test with a key likea/bwould confirm it.
Merged as 2a15682
What changes
A group's face can be changed by whoever holds
group.configure. These are new methods ingroup_config.rs:fyi.opensocial.updateProfilereplaces the profile:community.lexicon.location's.nullclears an image.createdAt: kept.fyi.opensocial.uploadImagekeeps an image of up to 1 MB as the group's blob and answers the reference to put in the profile.fyi.opensocial.putRulemakes or changes a rule:ordermoves it.fyi.opensocial.deleteRuletakes a rule away. Deleting one that isn't there is no error.The group test helpers move into
tests/common/groups.rs.docs/design/groups.mdgains "Changing its face", and the plan marks this part done.Why
This is the next part of 4d, following the prototype's
methods/profile.tsandmethods/rules.ts. These records are written by the group, so an admin can't write them directly. The host writes them after checking the caller's actions against the permissions record.Changes from the prototype:
[{topic}],[{language}]), as this host's lexicons have them.{ref, mimeType, size}: this host never sees the BlobRef instances the prototype had to repair.How it was checked
tests/group_config.rscovers:createdAt;nullclearing an image.just covis at 100% of lines and functions, and clippy is clean.Shortcomings
orderdoesn't renumber the others.🤖 Generated with Claude Code