chadtmiller.com/group-host
atmosphere group host
0
0
The console's role editor shows what a permission set gives
Merged Approved
This pull makes the roles editor offer the permission sets as choices of their own and shows what a set gives as ticked and greyed. It also adds a Change dialog for a role, and it adds viewer.grantable and per-scope actions to getGroup. I read the Rust, lexicon, actions.ts, RoleFields.svelte, RolesEditor.svelte, settings.ts and the roles page. I did not read the tests, docs, shots, seeds, messages or CSS.
I found nothing that must change.
- Escalation:
grantableuses the sameexpandedandcoverscheck as a role write, so the editor and the host's refusal stay in step. - Saved scopes: the form saves the ticked sets and actions plus the role's other scopes unchanged. A ticked action under a set is kept by a hidden input, because a disabled box isn't submitted.
- Not covered: I did not run anything.
Merged as 41016b1
A role holding
include:fyi.opensocial.authModerateorauthManageGroupshowed every action the set gives as ticked, and unticking one saved nothing different, since the set stayed. The roles editor now offers the sets as choices of their own, shows what a set gives as held because of it, and can change a role in place.Claude Opus 5.5 · high effort
What changes
The roles editor. Each role's row ends in a ⋯ menu with Change and Delete. Change opens Change this role, which works like Create a role. Under Running the group, the group's three permission sets are choices of their own: Profile and rules (
authManageProfile), Moderation (authModerate) and The whole group (authManageGroup, which isgroup.configure's scope, sogroup.configureis no longer an action you tick on its own). An action a ticked set gives shows ticked and greyed, with a short line naming the set ("Comes with moderation"). A smaller set The whole group covers shows the same way. To take one of those away, untick the set, or tick a smaller one, then tick the actions you want one by one. What a role has through scopes the editor doesn't show (Admin'sspace:*?manage=create&manage=delete,space:*?collection=*) says "Comes with its other permissions" and is kept as it was. Saving writes what the dialog shows: the ticked sets and actions, plus the role's other scopes unchanged. An action ticked on its own under a set stays ticked underneath and is still saved, so a moderator'sspace:*?collection=com.atproto.label.record(labels in every space, wider than the set's) is kept.Escalation. The editor offers only what the host would accept.
getGroupnow tells a member, asviewer.grantable, which of the actions' scopes and theauthManageProfileandauthModeratesets they hold enough of to add to a role. It uses the same check as a role write (expanded+covers,ScopeNotHeld). The editor shows a set or action if it's grantable or the role already has it (to take it away). It lists Change and Delete only for roles the viewer may assign, and in People with it can give, only roles they may assign (or the role already lists). A member whose role holds onlyauthManageGroup, for example, isn't offeredlabel(labels in every space) orspace.*.getGroup. Each scope in a role's binding now also says
actions, what the host reads it as granting (optionalactionsonfyi.opensocial.defs#scopeRef). The viewer'sgrantable(optional, members only) is on#viewerState. Both only add to the schema.Docs. The rules-and-roles guide covers the sets, has a new "How do I change a role?" section with two new pictures, and its delete steps now go through the menu;
just shotsredrew it. docs/design/membership.md describesgrantable, the per-scope actions and the editor; docs/reference/api.md mentionsgrantable. A look seed,roles, afterfull, adds a role with single actions only, and a steward role holding onlyauthManageGroup, which dan holds.Why
The editor showed what the host reads a role as granting (binding
actions), but saved only the scopes it had boxes for and kept every other scope, the sets included. So it could show nothing true about why an action was held, and unticking it did nothing. Making the set a choice of its own and greying what it gives keeps what's shown and what's saved the same. I asked the host for what a member may give, instead of working outcoversagain in TypeScript, so the editor and the host's refusal can't drift apart.Sets are tick boxes, not a single choice of tier, because
authManageProfileandauthModeratedon't contain each other: a role may carry both, and a single choice couldn't show it. The whole group contains both, and shows them greyed as coming with it.How it was checked
crates/group-host/tests/groups.rs: the founder'sgrantableis every action's scope and both sets. A plain member's is empty. A member holding onlyauthModeratemay givemod.read,mod.resolve,invite,admit,eject,role.assignandauthModerate, but notlabel, the profile set,space.*orgroup.configure. The admin binding's scopes carry their actions. Run locally:cargo test -p group-host --test groupspasses.harness/e2e/flows.spec.mjs"defining a role, then giving it less": creates a role with Moderation (admit ticked and disabled), then changes it. Unticking Moderation and ticking invite saves a role whose actions are exactlyinvite.npm run check(svelte-check, no warnings),harness/strings.mjs,layers.mjs,dialogs.mjs,just lex,just fmt,harness/docs.mjspass locally.just shots docs/guides/rules-and-roles.mdredrawn.just look: Admin (The whole group), Moderator (Moderation plus labels everywhere), Greeter (single actions), Create a role as dan (steward,authManageGrouponly: nolabelorspace.*offered), the ⋯ menu, on a phone and in the dark.just shots --checkare left to CI.Shortcomings
repo:*) can't be edited here. The editor says so ("Comes with its other permissions") and the guide points to the terminal.group.configuretag (the host's action name, where the dialog says The whole group); and the browser's grey for ticked boxes that can't be unticked, which is faint in light mode.group.configure, which isauthManageGroup, so "can't give The whole group" can't happen in the console. The escalation case drawn is a steward who can't give labels in every space or the space actions.