fix(desktop): 智能体授权不再限制仅管理员——所有企业成员均可创建授权(业务规则:A授权给B/C,授权后对方可调用A的智能体)
This commit is contained in:
@@ -38,7 +38,6 @@ import type { AgentSummary } from "../../api/types/agents";
|
||||
import { friendlyErrorMessage } from "../../utils/error";
|
||||
import { useCurrentUser } from "../../stores/communicationStore";
|
||||
import { useAuthStore } from "../../auth/authStore";
|
||||
import { isEnterpriseAdmin } from "../../auth/jwt";
|
||||
|
||||
const STATUS_META: Record<string, { color: string; label: string }> = {
|
||||
active: { color: "green", label: "生效中" },
|
||||
@@ -164,7 +163,6 @@ export default function AgentGrantsPage() {
|
||||
|
||||
const user = useCurrentUser();
|
||||
const authUser = useAuthStore((s) => s.user);
|
||||
const adminCompanies = isEnterpriseAdmin(authUser);
|
||||
const myIds = useMemo(() => {
|
||||
const ids = new Set<string>();
|
||||
if (user?.id) ids.add(user.id);
|
||||
@@ -294,15 +292,13 @@ export default function AgentGrantsPage() {
|
||||
</span>
|
||||
}
|
||||
extra={
|
||||
adminCompanies ? (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<PlusOutlined />}
|
||||
onClick={() => void openCreate()}
|
||||
>
|
||||
创建授权
|
||||
</Button>
|
||||
) : undefined
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<PlusOutlined />}
|
||||
onClick={() => void openCreate()}
|
||||
>
|
||||
创建授权
|
||||
</Button>
|
||||
}
|
||||
>
|
||||
<Alert
|
||||
@@ -315,9 +311,7 @@ export default function AgentGrantsPage() {
|
||||
<div><b>L1 企业管理员</b>:可无条件调用本企业任意成员的智能体,无需授权。</div>
|
||||
<div><b>L2 同企业互调</b>:同一企业内成员可互相调用彼此 <code>external_callable=True</code> 的智能体(企业=信任域)。</div>
|
||||
<div><b>L3 临时授权</b>:通过下方授权记录,限时/限次/限 prompt 前缀地授权其他成员调用自己的智能体。</div>
|
||||
{!adminCompanies && (
|
||||
<div style={{ marginTop: 4, color: "#fa8c16" }}>您当前为普通企业成员,仅可查看与自己相关的授权记录;企业管理员可创建/管理授权。</div>
|
||||
)}
|
||||
<div style={{ marginTop: 4, color: "#fa8c16" }}>所有企业成员均可创建授权:把自己的智能体授权给其他成员使用;企业管理员可无条件调用本企业任意成员的智能体,无需授权。</div>
|
||||
<div style={{ marginTop: 4, color: "#8c8c8c" }}>目标智能体关闭「允许外部调用」时,一切外部调用均被拒绝。</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user