Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(web): remove only-me resource access option (#40956)

Wu Tianwei8a33a9adb588
diff --git a/web/app/components/access-rules-editor/__tests__/index.spec.tsx b/web/app/components/access-rules-editor/__tests__/index.spec.tsx
index 6ef223cdee3..9652987e7f2 100644
--- a/web/app/components/access-rules-editor/__tests__/index.spec.tsx
+++ b/web/app/components/access-rules-editor/__tests__/index.spec.tsx
@@ -143,15 +143,12 @@ describe('AccessRulesEditor', () => {
const allMembersButton = screen.getByRole('button', {
name: /permission\.accessRule\.allPermittedMembers/,
})
- const onlyMeButton = screen.getByRole('button', { name: /permission\.accessRule\.onlyMe/ })
const specificMembersButton = screen.getByRole('button', {
name: /permission\.accessRule\.specificMembersOnly/,
})
expect(allMembersButton).toBeDisabled()
- expect(onlyMeButton).toBeDisabled()
expect(specificMembersButton).toBeDisabled()
expect(allMembersButton).toHaveAttribute('aria-pressed', 'false')
- expect(onlyMeButton).toHaveAttribute('aria-pressed', 'false')
expect(specificMembersButton).toHaveAttribute('aria-pressed', 'false')
})
@@ -201,7 +198,7 @@ describe('AccessRulesEditor', () => {
expect(onRemoveAccessPolicyMemberBinding).toHaveBeenCalledWith('account-1', 'app-policy-id')
})
- it('should render and update the only-me resource access scope', () => {
+ it('should hide the only-me option and allow changing a legacy only-me scope', () => {
const onOpenScopeChange = vi.fn()
render(
@@ -217,10 +214,9 @@ describe('AccessRulesEditor', () => {
/>,
)
- expect(screen.getByRole('button', { name: /permission\.accessRule\.onlyMe/ })).toHaveAttribute(
- 'aria-pressed',
- 'true',
- )
+ expect(
+ screen.queryByRole('button', { name: /permission\.accessRule\.onlyMe/ }),
+ ).not.toBeInTheDocument()
fireEvent.click(
screen.getByRole('button', { name: /permission\.accessRule\.specificMembersOnly/ }),
diff --git a/web/app/components/access-rules-editor/open-scope-section.tsx b/web/app/components/access-rules-editor/open-scope-section.tsx
index 8c24653dc50..8f3ecfe9a76 100644
--- a/web/app/components/access-rules-editor/open-scope-section.tsx
+++ b/web/app/components/access-rules-editor/open-scope-section.tsx
@@ -48,7 +48,7 @@ function ResourceOpenScopeSection({ value, disabled, onChange }: ResourceOpenSco
</h2>
<TitleInfotip content={resourceOpenScopeDescription} />
</div>
- <div className="grid grid-cols-1 gap-2 sm:grid-cols-3">
+ <div className="grid grid-cols-1 gap-2 sm:grid-cols-2">
<OpenScopeOption
value="all"
selected={value === 'all'}
@@ -59,14 +59,6 @@ function ResourceOpenScopeSection({ value, disabled, onChange }: ResourceOpenSco
})}
onChange={onChange ? handleRequestChange : undefined}
/>
- <OpenScopeOption
- value="only_me"
- selected={value === 'only_me'}
- disabled={disabled || !onChange}
- title={t(($) => $['accessRule.onlyMe'], { ns: 'permission' })}
- description={t(($) => $['accessRule.onlyMeDescription'], { ns: 'permission' })}
- onChange={onChange ? handleRequestChange : undefined}
- />
<OpenScopeOption
value="specific"
selected={value === 'specific'}