UnisKB/ui/src/api/user/resource-authorization.ts

44 lines
1.1 KiB
TypeScript
Raw Normal View History

2025-05-30 06:02:54 +00:00
import { Result } from '@/request/Result'
import { get, put, post, del } from '@/request/index'
import type { pageRequest } from '@/api/type/common'
import type { Ref } from 'vue'
const prefix = '/workspace'
/**
*
* @query
*/
const getResourceAuthorization: (workspace_id: String) => Promise<Result<any>> = (workspace_id) => {
return get(`${prefix}/${workspace_id}/user_resource_permission`)
}
/**
*
* @param member_id
* @param {
"team_resource_permission_list": [
{
"auth_target_type": "KNOWLEDGE",
"target_id": "string",
"auth_type": "ROLE",
"permission": {
"VIEW": true,
"MANAGE": true,
"ROLE": true
}
}
]
}
*/
const putResourceAuthorization: (workspace_id: String, body: any) => Promise<Result<any>> = (
workspace_id,
body,
) => {
return put(`${prefix}/${workspace_id}/user_resource_permission`, body)
}
export default {
getResourceAuthorization,
putResourceAuthorization,
}