manage-tenant-member
管理 Dataphin 租户成员,包括添加成员、移除成员、查询可添加用户、查询租户成员列表、配置全局角色。触发场景:添加租户成员 / 移除租户成员 / 租户角色配置 / 批量加人 / tenant member / 租户管理员。流程:list-addable-users 定位用户 →…
by aliyun★ 303 GitHub stars
Install manage-tenant-member in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
租户成员管理 Skill
1. Scenario Description
场景:在 Dataphin 租户维度进行组织级人员管理,包括将已有用户加入租户、调整全局角色、移除成员等。
Architecture
用户请求 → 确认参数 → list-addable-users 查找可添加用户
→ add-tenant-members / add-tenant-members-by-source-user 添加
→ list-tenant-members 验证
→(可选)update-tenant-member 更新角色
→(可选)remove-tenant-member 移除成员
涉及 Dataphin OpenAPI
ListAddableUsers— 查询可加入租户但尚未加入的用户AddTenantMembers— 按用户 ID 批量添加租户成员AddTenantMembersBySourceUser— 按来源用户批量添加租户成员ListTenantMembers— 查询当前租户成员ListAddableRoles— 查询可配置的全局角色UpdateTenantMember— 更新租户成员全局角色RemoveTenantMember— 移除租户成员
2. Installation
# 安装 aliyun CLI(>= 3.4.8)
# 各操作系统一键安装脚本见 ./references/cli-installation-guide.md
# 安装 dataphin-public 插件
aliyun plugin install --names aliyun-cli-dataphin-public
# 验证
aliyun dataphin-public --help
详见 CLI 安装指南。
3. Environment Variables
凭证与环境变量由父 skill
alibabacloud-dataphin-skills统一声明并预检(父 §3 + §4 Authentication + §8 Step 0,先于路由到本 skill 执行);本 skill 仅额外要求下列变量:
| 变量 | 说明 | 必须 |
|---|---|---|
DATAPHIN_INSECURE |
独立部署自签证书时设为 true 跳过 TLS 校验 |
独立部署必须 |
独立部署(非公共云)注意:
- 凭证 profile 必须带正确的
--endpoint(如dataphin-openapi.<your-domain>),否则请求会打到公共云dataphin-public.<region>.aliyuncs.com报InvalidAccessKeyId.NotFound。- 自签证书环境需
export DATAPHIN_INSECURE=true(推荐),或在命令末尾追加--insecure(--insecure非解析 flag,放在参数中间会吞掉下一个参数值)。
4. Authentication
Pre-check: Credentials Required
Security Rules:
- NEVER 读取、回显或打印凭证环境变量(禁止对 AccessKey ID / Secret 做任何输出或日志)
- NEVER 要求用户在本会话或命令行直接输入 AK/SK
- NEVER 使用
aliyun configure set写入字面量凭证- ONLY 使用
aliyun configure list检查凭证状态aliyun configure list检查输出中是否存在有效 profile(AK、STS 或 OAuth 身份)。
如果没有有效 profile,请在此停止。
- 从 Alibaba Cloud Console 获取凭证
- 在会话外配置(终端执行
aliyun configure,或在 shell profile 中设置环境变量)- 重新运行
aliyun configure list确认有效后再继续
Pre-check: Aliyun CLI plugin update required
[MUST] run
aliyun configure set --auto-plugin-install trueto enable automatic plugin installation. [MUST] runaliyun plugin updateto ensure that any existing plugins are always up-to-date.执行前确认 CLI 与插件版本:
aliyun version aliyun plugin list
5. RAM Policy
[MUST] Permission Failure Handling: When any command or API call fails due to permission errors at any point during execution, follow this process:
- Read
../../ram-policies.mdto get the full list of permissions required by this SKILL- Use
ram-permission-diagnoseskill to guide the user through requesting the necessary permissions- Pause and wait until the user confirms that the required permissions have been granted
本 skill 最小权限见 ../../ram-policies.md。
6. IMPORTANT: Parameter Confirmation
执行任何租户成员变更命令前必须向用户确认以下参数,禁止静默提交:
| 参数 | 说明 |
|---|---|
--tenant-id |
租户 ID(--op-tenant-id 的别名,profile 已配置时可省) |
| 用户标识 | 待添加/更新/移除的用户 ID 或来源用户 ID |
--member-list |
更新角色时的成员列表 JSON(含 UserId + RoleList) |
7. 完整命令链
TENANT_ID=<tenant-id>
USER_AGENT="AlibabaCloud-Agent-Skills/alibabacloud-dataphin-skills/{session-id} skill-version/{version}"
# 1) 查找可添加用户(支持按姓名/账号搜索)
aliyun dataphin-public list-addable-users --dataphin-profile <p> --tenant-id $TENANT_ID \
--search-text "<姓名或账号>" --page 1 --page-size 10 \
--user-agent "$USER_AGENT" --format json \
| jq '.PageResult.UserList[] | {Id, Name, AccountName, DisplayName, SourceType}'
# 2) 添加租户成员(按用户 ID)
# --user-list 每个参数是一个 JSON 对象字符串,不能传 JSON 数组
aliyun dataphin-public add-tenant-members --dataphin-profile <p> --tenant-id $TENANT_ID \
--user-list '{"Id":"<user-id-1>"}' '{"Id":"<user-id-2>"}' \
--user-agent "$USER_AGENT" --format json
# 3) 验证已加入租户
aliyun dataphin-public list-tenant-members --dataphin-profile <p> --tenant-id $TENANT_ID \
--search-text "<姓名或账号>" --page 1 --page-size 10 \
--user-agent "$USER_AGENT" --format json \
| jq '.PageResult.UserList[] | {Id, Name, AccountName, RoleList}'
# 4) 查看可配置的全局角色
# 注意:字段名是 Code / Name,不是 RoleCode / RoleName
aliyun dataphin-public list-addable-roles --dataphin-profile <p> --tenant-id $TENANT_ID \
--user-agent "$USER_AGENT" --format json \
| jq '.RoleList[] | {Code, Name}'
# 5) 更新成员全局角色
# --member-list 每个成员一个 JSON 对象字符串,含 UserId + RoleList 数组
# 可选字段:MobilePhone / Mail / DingNumber
aliyun dataphin-public update-tenant-member --dataphin-profile <p> --tenant-id $TENANT_ID \
--member-list '{"UserId":"<user-id>","RoleList":["SYSTEM_ADMIN","DATASOURCE_MANAGER"]}' \
--user-agent "$USER_AGENT" --format json
# 6) 移除租户成员
# --source-id 为用户来源 Id(即成员的用户 Id)
aliyun dataphin-public remove-tenant-member --dataphin-profile <p> --tenant-id $TENANT_ID \
--source-id '<user-id>' \
--user-agent "$USER_AGENT" --format json
8. Observability
版本 {version}(Shell 变量 SKILL_VERSION)来自套件 `references/ma
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
- references/acceptance-criteria.md
- references/cli-installation-guide.md
- references/related-commands.md
FAQ
What does the manage-tenant-member skill do?
管理 Dataphin 租户成员,包括添加成员、移除成员、查询可添加用户、查询租户成员列表、配置全局角色。触发场景:添加租户成员 / 移除租户成员 / 租户角色配置 / 批量加人 / tenant member / 租户管理员。流程:list-addable-users 定位用户 → add-tenant-members 添加 → list-tenant-members 验证;更新角色用 update-tenant-member;移除用 remove-tenant-member。关键点:add-tenant-members 的 --user-list 必须传单个 JSON 对象字符串 {"Id":"xxx"},不能传数组;仅 SuperAdmin / 系统管理员可调用;全局角色包括 SYSTEM_ADMIN / DATASOURCE_MANAGER / SECURITY_ADMIN / QUALITY_MANAGER / EXPORT_ADMIN / DATA_STANDARD_MANAGER / LABELS_BUSINESS_MEMBER / DATAPRO_OPERATE_ADMIN 等(完整枚举以 list-addable-roles 实际返回的 Code 字段为准)。触发词:租户成员、添加租户成员、移除租户成员、租户角色、tenant member、tenant administration。
How do I install the manage-tenant-member skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the manage-tenant-member skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…