Repository navigation
delete: knowledge export skills #7722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,10 +65,6 @@ const system = { | |
| * 系统「知识库」MCP配置详情权限 | ||
| */ | ||
| mcpConfig: () => canSys(P.RESOURCE_KNOWLEDGE_MCP_CONFIG), | ||
| /** | ||
| * 系统「知识库」导出权限 | ||
| */ | ||
| exportSkills: () => canSys(P.RESOURCE_KNOWLEDGE_EXPORT_SKILLS), | ||
| /** | ||
| * 系统「知识库」「定时同步」只读权限 | ||
| */ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Review of the diffWhat the diff does: removes the Potential issues
Style / minor
RecommendationIf the export capability is gone: delete the constant + all call sites + tests in the same commit. |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,10 +82,6 @@ const workspace = { | |
| * 工作空间「知识库」MCP配置详情权限 | ||
| */ | ||
| mcpConfig: (id: string) => canWorkspaceKnowledge(P.KNOWLEDGE_MCP_CONFIG, id), | ||
| /** | ||
| * 工作空间「知识库」导出权限 | ||
| */ | ||
| exportSkills: (id: string) => canWorkspaceKnowledge(P.KNOWLEDGE_EXPORT_SKILLS, id), | ||
| /** | ||
| * 工作空间「知识库」「定时同步」只读权限 | ||
| */ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on the provided diff, the change simply removes the /**
* 工作空间「知识库」导出权限
*/
exportSkills: (id: string) => canWorkspaceKnowledge(P.KNOWLEDGE_EXPORT_SKILLS, id),Here are the issues and suggestions to verify:
Overall: the diff is syntactically clean, but the main risk is dangling references or an inconsistent removal of the export feature/permission. Search the entire repository for |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the diff only, there are no syntax errors, but there are several risks and inconsistencies:
Commented-out code is a maintenance smell
//KNOWLEDGE_EXPORT_SKILLS...,//SHARED_KNOWLEDGE_EXPORT_SKILLS..., and//RESOURCE_KNOWLEDGE_EXPORT_SKILLS...leave dead code.//KNOWLEDGE...lacks a space after//; some lint rules flag commented-out code.Inconsistent removal strategy
APPLICATION_CLEAR_POLICYis deleted, while the three export-skills permissions are commented out.High risk of dangling references
KNOWLEDGE_EXPORT_SKILLSSHARED_KNOWLEDGE_EXPORT_SKILLSRESOURCE_KNOWLEDGE_EXPORT_SKILLSAPPLICATION_CLEAR_POLICYEXPORT_SKILLSCLEAR_POLICYPermissionConstants.KNOWLEDGE_EXPORT_SKILLS, but will not catch string-based/dynamic references, API payloads, role definitions, tests, or frontend permission keys.Operate.EXPORT_SKILLSorOperate.CLEAR_POLICYbecome unused enum members.Persisted permissions are not disabled by this diff
Check for fail-open authorization behavior
undefinedand the caller treats that as “allowed” or “no restriction,” export-skill access may remain possible. Ensure missing permission means deny.Numeric permission codes should not be reused
13,42,45, and64are now absent or commented out.RESERVED_PERMISSION_CODESentry, to prevent accidental reuse.Generated artifacts and permission consumers may need updates
Object.keys(PermissionConstants)orObject.values(PermissionConstants).Recommended approach
@deprecated, and gate authorization with a server-side feature flag. Add a ticket/reason comment.Operatevalues, remove all references, add a DB migration, and update tests/docs. Do not leave commented-out entries in committed code.In short: the diff is syntactically fine, but it needs a repo-wide reference audit, a database/permission migration plan, consistent handling of removed permissions, and confirmation that missing permissions fail closed.