From 270329bd823c215f8c20bfecf2975afa0f049b7c Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 9 Apr 2026 11:41:05 +0200 Subject: [PATCH] feat(15-01): add LocationInfo and ConsolidatedPermissionEntry model records - LocationInfo record holds five location fields (SiteUrl, SiteTitle, ObjectTitle, ObjectUrl, ObjectType) - ConsolidatedPermissionEntry record holds key fields plus IReadOnlyList Locations - LocationCount computed property returns Locations.Count --- .../Models/ConsolidatedPermissionEntry.cs | 21 +++++++++++++++++++ SharepointToolbox/Core/Models/LocationInfo.cs | 13 ++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 SharepointToolbox/Core/Models/ConsolidatedPermissionEntry.cs create mode 100644 SharepointToolbox/Core/Models/LocationInfo.cs diff --git a/SharepointToolbox/Core/Models/ConsolidatedPermissionEntry.cs b/SharepointToolbox/Core/Models/ConsolidatedPermissionEntry.cs new file mode 100644 index 0000000..02e274d --- /dev/null +++ b/SharepointToolbox/Core/Models/ConsolidatedPermissionEntry.cs @@ -0,0 +1,21 @@ +namespace SharepointToolbox.Core.Models; + +/// +/// A consolidated permission row produced by grouping UserAccessEntry rows +/// that share the same (UserLogin, PermissionLevel, AccessType, GrantedThrough) key. +/// All distinct locations for that key are collected into . +/// +public record ConsolidatedPermissionEntry( + string UserDisplayName, + string UserLogin, + string PermissionLevel, + AccessType AccessType, + string GrantedThrough, + bool IsHighPrivilege, + bool IsExternalUser, + IReadOnlyList Locations +) +{ + /// Convenience count — equals Locations.Count. + public int LocationCount => Locations.Count; +} diff --git a/SharepointToolbox/Core/Models/LocationInfo.cs b/SharepointToolbox/Core/Models/LocationInfo.cs new file mode 100644 index 0000000..45801a0 --- /dev/null +++ b/SharepointToolbox/Core/Models/LocationInfo.cs @@ -0,0 +1,13 @@ +namespace SharepointToolbox.Core.Models; + +/// +/// Holds the five location-related fields extracted from a UserAccessEntry +/// when permission rows are merged into a consolidated entry. +/// +public record LocationInfo( + string SiteUrl, + string SiteTitle, + string ObjectTitle, + string ObjectUrl, + string ObjectType +);