OCI Policy Analysis UI
Tkinter UI components for OCI Policy Analysis.
SettingsTab
- class oci_policy_analysis.ui.SettingsTab(*args: Any, **kwargs: Any)[source]
Bases:
BaseUITabSettings Tab for OCI Policy Analysis UI. Allows configuration of tenancy, profile, MCP server, and AI settings. All tenancy data is loaded via this tab.
- _on_ai_enablement_finished(success: bool, message: str, clear: bool = False)[source]
Callback from App once AI loading completes. Used to enable AI toggle button if successful.
- refresh_context_help()[source]
Refresh style/visibility of Page Help label. (SettingsTab extension point)
PoliciesTab
- class oci_policy_analysis.ui.PoliciesTab(*args: Any, **kwargs: Any)[source]
Bases:
BaseUITabTab for displaying and filtering OCI policies.
Supports searching and filtering by multiple criteria (OR via | character in fields).
Includes saved search/load, policy export, and summary displays.
Context help is unified and appears at the top, per app setting.
Provides right-click analysis and integration with other app tabs.
- clear_policy_filters()[source]
- export_policy_to_csv()[source]
- update_policy_output(*args)[source]
Update the policy output based on current filters.
- enable_widgets_after_load()[source]
Enable widgets after load.
DynamicGroupsTab
- class oci_policy_analysis.ui.DynamicGroupsTab(*args: Any, **kwargs: Any)[source]
Bases:
BaseUITabDynamic Groups Tab for OCI Policy Analysis UI.
Browse, filter, and analyze dynamic groups and related policies. Select dynamic groups to reveal matching policy statements below.
- apply_settings(context_help: bool, font_size: str)[source]
Update context help and font settings (called globally from main app).
- enable_controls()[source]
Called from main app when data is loaded to enable the controls
UsersTab
- class oci_policy_analysis.ui.UsersTab(*args: Any, **kwargs: Any)[source]
Bases:
BaseUITabUsers Tab for OCI Policy Analysis UI. Allows selection of Groups or Users, and displays associated policy statements. Supports filtering and detailed policy statement views.
- sync_load_all_users_checkbox()[source]
Ensures the checkbox/UI for load_all_users matches the repository state. Should be called after loading data/cache if UI lags behind data model.
- should_show_users_option()[source]
Returns True if the USERS option should be available in the dropdown, i.e., only if load_all_users is True AND there are users loaded.
- update_users_dropdown_options()[source]
Update the GROUPS/USERS dropdown menu to reflect actual repo state. Should be called after any tenancy/repo load; safe to call any time. Also forces the table below to reload for the current selection.
- update_user_analysis_output()[source]
Update the user/group table based on selection and search. Called initially after load from main class and when search or selection changes.
- update_user_policy_output()[source]
Update the display elements for the user analysis policy statements. Called when the selection of groups/users changes, or when the checkboxes change.
ReportTab
ConsoleTab
PolicyRecommendationsTab
- class oci_policy_analysis.ui.PolicyRecommendationsTab(*args: Any, **kwargs: Any)[source]
Bases:
BaseUITabUnified UI tab for displaying Oracle Cloud Policy Recommendations and analytics.
- This tab contains an internal notebook with subtabs for:
Risk assessment and scores for policy statements
Policy overlap analysis (potential overrides/superseding statements)
Consolidation opportunities
Policy hygiene and clean-up actions
Future analytics extensions
- Parameters:
parent (tk.Widget) – The parent widget for this frame.
app (Any) – The main application object containing state and analysis engines.
- app
The main application reference with policy and intelligence engines.
- Type:
Any
- policy_repo
Reference to analysis data for rendering UI.
- recommendation_table
DataTable widget for summary.
- notebook
ttk.Notebook for switching between analytics views.
- risk_table
DataTable for risk scores.
- overlap_table
DataTable for policy overlaps.
- consolidation_table
CheckboxTable for consolidation findings.
- cleanup_table
CheckboxTable for actionable cleanup/fix items.
- reload_all_analytics()[source]
- update_risk_tab_output()[source]
- update_overlap_tab_output()[source]
- update_consolidation_tab_output()[source]
Refresh the consolidation tab’s data after analytics reload.
- update_cleanup_tab_output()[source]
Refresh the cleanup tab’s data after analytics reload.
McpTab
ResourcePrincipalsTab
- class oci_policy_analysis.ui.ResourcePrincipalsTab(*args: Any, **kwargs: Any)[source]
Bases:
BaseUITabResource Principals Tab for OCI Policy Analysis UI.
Allows viewing Dynamic Groups and associated policy statements, with contextual page help. Now inherits from BaseUITab. .. method:: __init__
Initializes the ResourcePrincipalsTab with UI components and context help.
- update_principals_sheets()[source]
Updates sheets based on dropdown and DG selection (called from main app, or internally).
- update_principals_sheets(*args)[source]
Update view: show or hide tables depending on dropdown, update data in both tables.
In DG mode, show both tables; in other principal modes, show only matching policy table, hiding DG table.
Refresh table data for all cases.
Text filter field applies to Matching Rule (DG) or Policy Statement (any-user modes).
MaintenanceTab
- class oci_policy_analysis.ui.MaintenanceTab(*args: Any, **kwargs: Any)[source]
Bases:
FrameMaintenance Tab for OCI Policy Analysis UI. Provides cache management and permissions testing tools. .. method:: __init__
Initializes the MaintenanceTab with UI components and callbacks.
- _maintenance_preserve_selected_cache()[source]
(Internal) Toggles the preserve status of the selected cache entry.
- _maintenance_permissions_load_data()[source]
(Internal) Loads reference data for permissions testing.
- _maintenance_get_permission()[source]
(Internal) Retrieves permissions for the selected resource/family and verb.
DataTable
- class oci_policy_analysis.ui.DataTable(*args: Any, **kwargs: Any)[source]
Bases:
FrameA Tkinter table widget with alternating row colors, sortable columns, resizable columns, show/hide columns, row selection with callback, full space utilization, cell copy functionality, and row context menu.
Note: for checklist-style tables with checkboxes and custom action button, see the more generic CheckboxTable class also defined below.
Note: ttk.Treeview does not natively support multi-line text wrapping. Text with newlines may appear clipped; use wider columns (via column_widths) for better visibility. Font, padding, and ttk.Style must be configured externally to include right-side cell padding (e.g., padding=(0, 0, 5, 0)) for column separation.
- parent
The parent Tkinter widget.
- columns
List of all possible column names.
- display_columns
List of initially displayed column names.
- data
List of dictionaries containing row data.
- sortable
Enable/disable column sorting (default: True).
- row_colors
Tuple of colors for alternating rows (default: white, light gray).
- selection_callback
Optional function to call with selected rows (default: None). Can be omitted if no callback is needed.
- multi_select
Enable/disable multi-row selection (default: False).
- column_widths
Dictionary mapping column names to initial widths (default: None, uses 100 for all columns).
Optional function to create a context menu for a row (default: None).