---
phase: 08-simplified-permissions
plan: 03
type: execute
wave: 3
depends_on: ["08-02"]
files_modified:
- SharepointToolbox/Views/Tabs/PermissionsView.xaml
autonomous: true
requirements:
- SIMP-01
- SIMP-02
- SIMP-03
must_haves:
truths:
- "A Simplified Mode toggle checkbox appears in the left panel scan options"
- "A Detail Level selector (Simple/Detailed) appears when simplified mode is on"
- "When simplified mode is on, the Permission Levels column shows plain-language labels instead of raw role names"
- "Permission level cells are color-coded by risk level (red=High, orange=Medium, green=Low, blue=ReadOnly)"
- "A summary panel shows counts per risk level with color indicators above the DataGrid"
- "When detail level is Simple, the DataGrid is hidden and only the summary panel is visible"
- "When detail level is Detailed, both summary panel and DataGrid rows are visible"
artifacts:
- path: "SharepointToolbox/Views/Tabs/PermissionsView.xaml"
provides: "Updated permissions view with toggles, color coding, and summary panel"
contains: "IsSimplifiedMode"
key_links:
- from: "SharepointToolbox/Views/Tabs/PermissionsView.xaml"
to: "SharepointToolbox/ViewModels/Tabs/PermissionsViewModel.cs"
via: "DataBinding to IsSimplifiedMode, IsDetailView, ActiveItemsSource, Summaries"
pattern: "Binding IsSimplifiedMode"
---
Update PermissionsView.xaml to add the simplified mode toggle, detail level selector, color-coded permission cells, and summary panel with risk level counts.
Purpose: This is the visual layer for SIMP-01 (plain labels), SIMP-02 (color-coded summary), and SIMP-03 (detail level toggle). Binds to ViewModel properties created in 08-02.
Output: Updated PermissionsView.xaml
@C:/Users/dev/.claude/get-shit-done/workflows/execute-plan.md
@C:/Users/dev/.claude/get-shit-done/templates/summary.md
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/phases/08-simplified-permissions/08-01-SUMMARY.md
@.planning/phases/08-simplified-permissions/08-02-SUMMARY.md
From PermissionsViewModel (updated):
```csharp
// New toggle properties
[ObservableProperty] private bool _isSimplifiedMode;
[ObservableProperty] private bool _isDetailView = true;
// Computed collections
public IReadOnlyList SimplifiedResults { get; }
public IReadOnlyList Summaries { get; }
public object ActiveItemsSource { get; } // Switches between Results and SimplifiedResults
// Existing (unchanged)
public ObservableCollection Results { get; }
```
From SimplifiedPermissionEntry:
```csharp
public string ObjectType { get; }
public string Title { get; }
public string Url { get; }
public bool HasUniquePermissions { get; }
public string Users { get; }
public string PermissionLevels { get; } // Raw role names
public string SimplifiedLabels { get; } // Plain-language labels
public RiskLevel RiskLevel { get; } // High/Medium/Low/ReadOnly
public string GrantedThrough { get; }
public string PrincipalType { get; }
```
From PermissionSummary:
```csharp
public record PermissionSummary(string Label, RiskLevel RiskLevel, int Count, int DistinctUsers);
```
From RiskLevel:
```csharp
public enum RiskLevel { High, Medium, Low, ReadOnly }
```
Task 1: Add toggles, summary panel, and color-coded DataGrid to PermissionsView.xamlSharepointToolbox/Views/Tabs/PermissionsView.xaml
Replace the entire content of `SharepointToolbox/Views/Tabs/PermissionsView.xaml` with the updated XAML below. Key changes from the original:
1. Added `xmlns:models` namespace for RiskLevel enum reference in DataTriggers
2. Added "Display Options" GroupBox in left panel with Simplified Mode toggle and Detail Level radio buttons
3. Added summary panel (ItemsControl bound to Summaries) between left panel and DataGrid
4. DataGrid now binds to `ActiveItemsSource` instead of `Results`
5. Added "Simplified Labels" column visible only in simplified mode (via DataTrigger on Visibility)
6. Permission Levels column cells are color-coded by RiskLevel using DataTrigger
7. DataGrid visibility controlled by IsDetailView when in simplified mode
8. Summary panel visibility controlled by IsSimplifiedMode
```xml
```
IMPORTANT implementation notes:
1. **InvertBoolConverter** — The "Simple" radio button needs an inverted bool converter to bind to `IsDetailView` (Simple = !IsDetailView). Add this converter to the UserControl.Resources:
```xml
```
You will need to create a simple `InvertBoolConverter` class. Add it as a nested helper or in a new file `SharepointToolbox/Core/Converters/InvertBoolConverter.cs`:
```csharp
using System.Globalization;
using System.Windows.Data;
namespace SharepointToolbox.Core.Converters;
///
/// Inverts a boolean value. Used for radio button binding where
/// one option is the inverse of the bound property.
///
[ValueConversion(typeof(bool), typeof(bool))]
public class InvertBoolConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
=> value is bool b ? !b : value;
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
=> value is bool b ? !b : value;
}
```
Add the namespace to the XAML header:
```xml
xmlns:converters="clr-namespace:SharepointToolbox.Core.Converters"
```
And update the resource to use `converters:InvertBoolConverter`.
2. **Row color DataTriggers** — The RiskLevel-based row coloring only takes effect when ActiveItemsSource contains SimplifiedPermissionEntry objects (which have RiskLevel). When binding to raw PermissionEntry (simplified mode off), the triggers simply don't match and rows use default background.
3. **SimplifiedLabels column** — Uses BooleanToVisibilityConverter bound to the DataGrid's DataContext.IsSimplifiedMode. When simplified mode is off, the column is Collapsed.
4. **Summary card "user(s)" text** — Uses `` elements inside TextBlock for inline binding. The hardcoded "user(s)" text will be replaced with a localization key in plan 08-05.
5. **DataGrid hides when simplified + not detailed** — MultiDataTrigger on IsSimplifiedMode=True AND IsDetailView=False collapses the DataGrid, showing only the summary cards.
cd "C:\Users\dev\Documents\projets\Sharepoint" && dotnet build SharepointToolbox/SharepointToolbox.csproj --no-incremental 2>&1 | tail -5PermissionsView.xaml has: Display Options GroupBox with Simplified Mode checkbox and Simple/Detailed radio buttons. Summary panel with 4 risk-level cards (color-coded). DataGrid binds to ActiveItemsSource with RiskLevel-based row colors. Simplified Labels column appears only in simplified mode. DataGrid hides in Simple mode. InvertBoolConverter created.
- `dotnet build SharepointToolbox/SharepointToolbox.csproj` succeeds with 0 errors
- PermissionsView.xaml contains bindings for IsSimplifiedMode, IsDetailView, ActiveItemsSource, Summaries
- InvertBoolConverter.cs exists and compiles
- Summary panel uses DataTrigger on RiskLevel for color coding
- DataGrid row style uses DataTrigger on RiskLevel for row background colors
- SimplifiedLabels column visibility bound to IsSimplifiedMode via BoolToVis converter
The permissions tab visually supports all three SIMP requirements: simplified labels appear alongside raw names (SIMP-01), summary cards show color-coded counts by risk level (SIMP-02), and the Simple/Detailed toggle controls row visibility without re-scanning (SIMP-03). Ready for export integration (08-04) and localization (08-05).