Skip to content

feat(cli): Add node permission management commands#602

Open
zhuzihao-hz wants to merge 1 commit intolanggenius:mainfrom
zhuzihao-hz:main
Open

feat(cli): Add node permission management commands#602
zhuzihao-hz wants to merge 1 commit intolanggenius:mainfrom
zhuzihao-hz:main

Conversation

@zhuzihao-hz
Copy link

@zhuzihao-hz zhuzihao-hz commented Feb 7, 2026

Description

Add support for setting node permissions through the CLI, enabling users to configure node permissions directly from the command-line interface.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Performance improvement
  • Other

Essential Checklist

Testing

  • I have tested the changes locally and confirmed they work as expected
  • I have added unit tests where necessary and they pass successfully

Additional Information

image

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Feb 7, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @zhuzihao-hz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the command-line interface by integrating comprehensive node permission management. It provides users with the ability to directly configure whether nodes can be invoked within Dify's ChatFlow and Workflow features, streamlining administrative tasks from the terminal.

Highlights

  • New Permission Key: Introduced 'node.enabled' as a new permission key, allowing for the management of node invocation within Dify ChatFlow/Workflow.
  • CLI Display Update: The command-line interface's permission view now includes a dedicated 'Nodes' section to display the current status of the 'node.enabled' permission.
  • Permission Toggling Logic: Implemented functionality within the CLI's edit mode to toggle the 'node.enabled' permission, enabling or disabling node invocation.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • cmd/commandline/plugin/permission.go
    • Added 'node.enabled' to the permissionKeySeq slice, making it a recognized permission for CLI management.
    • Modified the View() method to include a new 'Nodes:' section and display the status of 'node.enabled'.
    • Implemented logic in the edit() method to handle the toggling of 'node.enabled', updating the p.permission.Node field to enable or disable node invocation.
Activity
  • The author has categorized this as a new feature.
  • Local testing has been performed and confirmed to work as expected.
  • An image demonstrating the feature's functionality has been included in the pull request description.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@dosubot dosubot bot added enhancement New feature or request plugin-daemon labels Feb 7, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for managing node permissions in the CLI. The changes are well-implemented and consistent with the existing code structure for other permission types. I've added one comment regarding code duplication in the edit method, which could be addressed in a future refactoring to improve long-term maintainability. Overall, the changes look good and address the feature requirement effectively.

Comment on lines +181 to +189
if p.cursor == "node.enabled" {
if p.permission.AllowInvokeNode() {
p.permission.Node = nil
} else {
p.permission.Node = &plugin_entities.PluginPermissionNodeRequirement{
Enabled: true,
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This logic for toggling a boolean permission is almost identical to the logic for other permissions (e.g., app.enabled). This code duplication makes the edit function longer and harder to maintain with each new permission.

To improve maintainability, consider abstracting this repeated pattern. A future refactoring could introduce a helper function or a map-based dispatcher to handle these simple toggle cases, reducing redundancy and making the code more scalable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request plugin-daemon size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant