更新平台治理

This commit is contained in:
wangjiming
2026-08-17 09:15:36 +08:00
parent de9c8e4ffe
commit 6c1bf61ff7
13 changed files with 561 additions and 339 deletions

View File

@@ -0,0 +1,23 @@
import { get, put } from '../request'
/** ACL 条目 */
export interface AclEntry {
principal_type: 'user' | 'role'
principal_id: string
permissions: string[]
}
/** 资源 ACL含已有条目 */
export interface ResourceAcl {
resource_type: string
resource_id: string
entries: AclEntry[]
}
/** 查询资源 ACL */
export const getResourceAcl = (resourceType: string, resourceId: string) =>
get<ResourceAcl>(`/resources/${resourceType}/${resourceId}/acl`)
/** 设置资源 ACL */
export const setResourceAcl = (resourceType: string, resourceId: string, entries: AclEntry[]) =>
put<ResourceAcl>(`/resources/${resourceType}/${resourceId}/acl`, { entries })

View File

@@ -30,7 +30,7 @@ export const deleteTenant = (id: string) => del(`/tenants/${id}`)
/** 设置租户配额 */
export const setTenantQuota = (id: string, quota: Record<string, unknown>) =>
put<Tenant>(`/tenants/${id}/quota`, { quota })
put<Tenant>(`/tenants/${id}/quota`, quota)
/** 设置租户留存策略 */
export const setTenantRetention = (id: string, retention_policy_id: string) =>