[PR #10946] Solution/role based app setting[WIP] #27000

Closed
opened 2026-02-21 20:40:40 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/10946

State: closed
Merged: No


Summary

This PR introduces a new is_admin property in the Account model and the corresponding utility method is_admin_role in the TenantAccountRole class. Additionally, it updates the AppService logic to prevent non-admin users from modifying the enable_site property. These changes enhance access control and ensure only administrators can manage critical application settings.

Key Changes:

  • Added is_admin property to the Account model to simplify admin checks.

  • Added is_admin_role static method to TenantAccountRole to encapsulate role-specific logic.

  • Updated AppService to include a check for current_user.is_admin before updating the enable_site property.

  • Included commented-out alternative implementation for handling the enable_site property for potential future use.

    Fixes # (replace with the relevant issue number or remove if not applicable).

**Original Pull Request:** https://github.com/langgenius/dify/pull/10946 **State:** closed **Merged:** No --- # Summary This PR introduces a new is_admin property in the Account model and the corresponding utility method is_admin_role in the TenantAccountRole class. Additionally, it updates the AppService logic to prevent non-admin users from modifying the enable_site property. These changes enhance access control and ensure only administrators can manage critical application settings. # Key Changes: - Added is_admin property to the Account model to simplify admin checks. - Added is_admin_role static method to TenantAccountRole to encapsulate role-specific logic. - Updated AppService to include a check for current_user.is_admin before updating the enable_site property. - Included commented-out alternative implementation for handling the enable_site property for potential future use. Fixes # (replace with the relevant issue number or remove if not applicable).
yindo added the pull-request label 2026-02-21 20:40:40 -05:00
yindo closed this issue 2026-02-21 20:40:40 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#27000