跳到主要内容

角色与权限

该分类包含 19 条以 system.role. 开头的 Runtime 系统命令。

1. 列出角色​

完整命令:system.role.list

列出角色。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:读取

sl system role list \
[--keyword value] [--cursor value] [--limit n] [--json]

参数:

  • keyword(可选)— Matches role name, code, and description; at most 200 characters
  • cursor(可选)— Opaque nextCursor returned by the previous request
  • limit(可选)— Maximum rows to return, 1-100; defaults to 20

2. 获取角色​

完整命令:system.role.get

获取角色资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:读取

sl system role get --role-id <uuid> [--json]

参数:

  • roleId(必填)— Exact role UUID returned by system.role.list

3. 创建角色​

完整命令:system.role.create

创建角色资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:写入

sl system role create \
(--definition-json json|--definition-file path) [--json]

参数:

  • code(必填)— Immutable lowercase role code: 2-64 letters, digits, or underscores; starts with a letter
  • name(必填)— Role display name, 1-200 characters
  • description(可选)— Optional description, null clears it

4. 复制角色​

完整命令:system.role.duplicate

复制角色资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:写入

sl system role duplicate \
--source-role-id <uuid> \
(--definition-json json|--definition-file path) [--json]

参数:

  • sourceRoleId(必填)— Editable source role UUID; authorization roles require a space administrator
  • code(必填)— Unique code for the new role
  • name(必填)— Display name for the new role
  • description(可选)— Description for the new role

5. 更新角色​

完整命令:system.role.update

更新角色资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:写入

sl system role update \
--role-id <uuid> (--definition-json json|--definition-file path) \
[--json]

参数:

  • roleId(必填)— Exact role UUID returned by system.role.list
  • name|description|status(必填)— Provide at least one change. status is active or disabled

6. 删除角色​

完整命令:system.role.delete

删除角色资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:高风险

sl system role delete --role-id <uuid> [--json]

参数:

  • roleId(必填)— Exact role UUID returned by system.role.list

7. 列出绑定​

完整命令:system.role.binding.list

列出角色绑定。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:读取

sl system role binding list --role-id <uuid> [--json]

参数:

  • roleId(必填)— Exact role UUID returned by system.role.list

8. 创建绑定​

完整命令:system.role.binding.create

创建角色绑定资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:写入

sl system role binding create \
--role-id <uuid> (--definition-json json|--definition-file path) \
[--json]

参数:

  • roleId(必填)— Exact role UUID returned by system.role.list
  • principalType(必填)— MEMBER, DEPARTMENT, or ORGANIZATION
  • principalId(必填)— Existing tenant principal UUID matching principalType
  • enabled(可选)— Defaults to true
  • startAt|endAt(可选)— Optional ISO timestamps with offsets. endAt must be later than startAt

9. 更新绑定​

完整命令:system.role.binding.update

更新角色绑定资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:写入

sl system role binding update \
--role-id <uuid> --binding-id <uuid> \
(--definition-json json|--definition-file path) [--json]

参数:

  • roleId(必填)— Exact role UUID returned by system.role.list
  • bindingId(必填)— Binding UUID returned by binding.list
  • enabled|startAt|endAt(必填)— Provide at least one change. null removes a time boundary

10. 删除绑定​

完整命令:system.role.binding.delete

删除角色绑定资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:高风险

sl system role binding delete \
--role-id <uuid> --binding-id <uuid> [--json]

参数:

  • roleId(必填)— Exact role UUID returned by system.role.list
  • bindingId(必填)— Binding UUID returned by binding.list

11. 获取权限编辑器​

完整命令:system.role.permission.editor.get

获取角色权限编辑器资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:读取

sl system role permission editor get --role-id <uuid> [--json]

参数:

  • roleId(必填)— Exact role UUID returned by system.role.list

12. 替换权限​

完整命令:system.role.permission.replace

替换角色权限资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:写入

sl system role permission replace \
--role-id <uuid> (--definition-json json|--definition-file path) \
[--json]

参数:

  • roleId(必填)— Exact role UUID returned by system.role.list
  • permissionCategory(可选)— feature or resource. Omit only for a deliberate full replacement
  • entries(必填)— Complete permission entries for the selected category or for the whole role when category is omitted. Newly added allows must be permissions the caller already holds

13. 解释权限​

完整命令:system.role.permission.explain

解释角色权限资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:读取

sl system role permission explain \
(--definition-json json|--definition-file path) [--json]

参数:

  • subjectType(必填)— MEMBER, DEPARTMENT, or ORGANIZATION
  • subjectId(必填)— Existing subject UUID matching subjectType
  • formId(可选)— Optional form UUID for form-level evaluation
  • recordId(可选)— Optional record UUID. Requires formId and enables row-policy explanation

14. 获取数据策略编辑器​

完整命令:system.role.data-policy.editor.get

获取角色数据策略编辑器资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:读取

sl system role data-policy editor get \
--role-id <uuid> --form-id <uuid> [--json]

参数:

  • roleId(必填)— Exact role UUID returned by system.role.list
  • formId(必填)— Exact form UUID

15. 替换数据策略​

完整命令:system.role.data-policy.replace

替换角色数据策略资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:写入

sl system role data-policy replace \
--role-id <uuid> --form-id <uuid> \
(--definition-json json|--definition-file path) [--json]

参数:

  • roleId(必填)— Exact role UUID returned by system.role.list
  • formId(必填)— Form whose role data policies are fully replaced
  • entries(必填)— Complete data-policy set for this role and form. Empty clears all non-system entries

16. 列出条件共享​

完整命令:system.role.condition-share.list

列出角色条件共享。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:读取

sl system role condition-share list [--form-id <uuid>] [--json]

参数:

  • formId(可选)— Optional form UUID filter

17. 创建条件共享​

完整命令:system.role.condition-share.create

创建角色条件共享资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:写入

sl system role condition-share create \
(--definition-json json|--definition-file path) [--json]

参数:

  • definition(必填)— Strict command definition; unknown fields are rejected

18. 更新条件共享​

完整命令:system.role.condition-share.update

更新角色条件共享资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:写入

sl system role condition-share update \
--rule-id <uuid> (--definition-json json|--definition-file path) \
[--json]

参数:

  • ruleId(必填)— Condition-share rule UUID returned by list
  • definition(必填)— Strict command definition; unknown fields are rejected

19. 删除条件共享​

完整命令:system.role.condition-share.delete

删除角色条件共享资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:高风险

sl system role condition-share delete --rule-id <uuid> [--json]

参数:

  • ruleId(必填)— Condition-share rule UUID returned by list