Skip to content
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

Solution/role based app setting[WIP] #10946

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

KMerdan
Copy link

@KMerdan KMerdan commented Nov 21, 2024

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant