Conversation
tabcmd Classic accepts a default site role for the group at creation time via --role/-r; users added later without an explicit role inherit this default. tabcmd 2 was missing the flag, so groups were always created with no minimum_site_role. Reuse UserCommand.set_role_arg for the same choices and case-insensitive parsing that createsiteusers/removeusers use, and set GroupItem.minimum_site_role before calling groups.create when the flag was supplied. TSC handles the wire-format via update_req(). Fixes #435.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Add a command-level test verifying the supplied role reaches server.groups.create.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Adds Classic-compatible --role/-r support to creategroup.
Changes:
- Adds role parsing and validation.
- Sets
GroupItem.minimum_site_rolewhen supplied. - Adds parser coverage for role variants.
| File | Summary |
|---|---|
tests/parsers/test_parser_create_group.py |
Adds role parsing tests. |
tabcmd/commands/group/create_group_command.py |
Adds role handling during group creation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if getattr(args, "role", None): | ||
| # Classic parity: --role/-r sets the group's default site role, so | ||
| # users added later without an explicit role inherit this one. | ||
| new_group.minimum_site_role = args.role |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #435.
Motivation
tabcmd Classic accepts
--role/-roncreategroupto set a defaultsite role for the group; users added later without an explicit role
inherit that default. tabcmd 2 was missing the flag, so groups always
got created with no
minimum_site_role. Classic-parity gap for anyonemanaging groups via scripts.
Behavior change
For users:
--role/-raccepted oncreategroup. SetsGroupItem.minimum_site_rolebeforeserver.groups.createwhensupplied. Reuses
UserCommand.set_role_argfor choices andcase-insensitive parsing, matching sibling user commands.
Test plan
tests/parsers/test_parser_create_group.py— 4 new tests:--role Viewer,-r Explorer, case-insensitivecreator->Creator, flag-optionaltest_parser_create_group.pysuite: 6 passed🤖 Generated with Claude Code