Skip to content

[feature][PES][configuration] add admin delete function for user config #1065

Description

@v-kkhuang

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Problem Description

Currently, the Linkis configuration management module only supports viewing and editing user-level configuration values but lacks the ability to delete invalid or outdated configurations. This leads to configuration accumulation over time, making it difficult for administrators to maintain a clean and efficient configuration environment.

Description

This feature aims to add admin-only delete functionality for user configuration values, allowing administrators to remove invalid or outdated user-level configurations through the UI.

The implementation includes:

  • Backend: Add deleteKeyValueByAdmin API endpoint with admin permission check
  • Frontend: Add delete button in configuration management table (admin-only visibility)
  • Security: Admin permission validation on both frontend and backend

Use case

Scenario: An administrator needs to clean up test configurations that were created during development but are no longer needed.

Expected Behavior:

  1. Administrator logs in and navigates to Configuration Management page
  2. Delete button is visible only for admin users
  3. Clicking delete button shows confirmation dialog with config details
  4. Confirming deletion removes the configuration and refreshes the list
  5. Non-admin users cannot see or access the delete function

Solutions

Alternative Considered:

  • Allow users to delete their own configurations
    • Rejected: Could lead to accidental deletions by inexperienced users

Chosen Approach:

  • Admin-only deletion with double confirmation
  • Permission check on both frontend and backend layers
  • Clear warning messages about irreversibility

Anything else

Implementation Details:

  • Uses existing Configuration.isAdmin() for permission check
  • Adds new endpoint DELETE /configuration/admin/keyvalue
  • Includes comprehensive test cases for P0 and P1 scenarios
  • Maintains full backward compatibility

Testing Coverage:

  • 18 test cases covering UI, API, security, and compatibility
  • Code review verification completed
  • Test score: 9.6/10 (Excellent)

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions