fix(sandbox-provider): allow admin role to manage sandbox providers

Change permission check from isCurrentWorkspaceOwner to
isCurrentWorkspaceManager so both owner and admin roles can
configure sandbox providers.
This commit is contained in:
yyh
2026-01-13 17:17:36 +08:00
parent 5675a44ffd
commit c6ba51127f

View File

@ -12,7 +12,7 @@ import SwitchModal from './switch-modal'
const SandboxProviderPage = () => {
const { t } = useTranslation()
const { isCurrentWorkspaceOwner, isLoadingCurrentWorkspace } = useAppContext()
const { isCurrentWorkspaceManager, isLoadingCurrentWorkspace } = useAppContext()
const { data: providers, isLoading } = useGetSandboxProviderList()
const [configModalProvider, setConfigModalProvider] = useState<SandboxProvider | null>(null)
@ -49,7 +49,7 @@ const SandboxProviderPage = () => {
provider={currentProvider}
isCurrent
onConfig={() => handleConfig(currentProvider)}
disabled={!isCurrentWorkspaceOwner}
disabled={!isCurrentWorkspaceManager}
/>
</div>
)}
@ -67,14 +67,14 @@ const SandboxProviderPage = () => {
provider={provider}
onConfig={() => handleConfig(provider)}
onEnable={() => handleEnable(provider)}
disabled={!isCurrentWorkspaceOwner}
disabled={!isCurrentWorkspaceManager}
/>
))}
</div>
</div>
)}
{!isLoadingCurrentWorkspace && !isCurrentWorkspaceOwner && (
{!isLoadingCurrentWorkspace && !isCurrentWorkspaceManager && (
<div className="system-xs-regular text-text-tertiary">
{t('sandboxProvider.noPermission', { ns: 'common' })}
</div>