From 92a50c3df58071f470327bdacacecf705545a9d8 Mon Sep 17 00:00:00 2001 From: ryjiang Date: Tue, 28 Nov 2023 19:27:51 +0800 Subject: [PATCH] Rbac (#259) * update RBAC consts Signed-off-by: ryjiang * add missing types Signed-off-by: ryjiang --------- Signed-off-by: ryjiang --- milvus/types/User.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/milvus/types/User.ts b/milvus/types/User.ts index a068a0ce..84026ea4 100644 --- a/milvus/types/User.ts +++ b/milvus/types/User.ts @@ -49,25 +49,30 @@ export interface ListCredUsersResponse extends resStatusResponse { usernames: string[]; } -type RoleEntity = { name: string }; -type User = { name: string }; -type RoleResult = { users: User[]; role: RoleEntity }; +export type RoleEntity = { name: string }; +export type User = { name: string }; +export type RoleResult = { + users: User[]; + role: RoleEntity; + entities: GrantEntity[]; +}; export interface SelectRoleResponse extends resStatusResponse { results: RoleResult[]; } -type UserResult = { user: User; roles: RoleEntity[] }; +export type UserResult = { user: User; roles: RoleEntity[] }; export interface SelectUserResponse extends resStatusResponse { results: UserResult[]; } -type ObjectEntity = { name: RbacObjects }; -type PrivilegeEntity = { name: PrivilegesTypes }; -type Grantor = { user: User; privilege: PrivilegeEntity }; -type GrantEntity = { +export type ObjectEntity = { name: RbacObjects }; +export type PrivilegeEntity = { name: PrivilegesTypes }; +export type Grantor = { user: User; privilege: PrivilegeEntity }; +export type GrantEntity = { role: RoleEntity; object: ObjectEntity; object_name: string; grantor: Grantor; + db_name: string; }; export interface SelectGrantResponse extends resStatusResponse { entities: GrantEntity[];