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<LocationInfo> Locations - LocationCount computed property returns Locations.Count
This commit is contained in:
21
SharepointToolbox/Core/Models/ConsolidatedPermissionEntry.cs
Normal file
21
SharepointToolbox/Core/Models/ConsolidatedPermissionEntry.cs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
namespace SharepointToolbox.Core.Models;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 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 <see cref="Locations"/>.
|
||||||
|
/// </summary>
|
||||||
|
public record ConsolidatedPermissionEntry(
|
||||||
|
string UserDisplayName,
|
||||||
|
string UserLogin,
|
||||||
|
string PermissionLevel,
|
||||||
|
AccessType AccessType,
|
||||||
|
string GrantedThrough,
|
||||||
|
bool IsHighPrivilege,
|
||||||
|
bool IsExternalUser,
|
||||||
|
IReadOnlyList<LocationInfo> Locations
|
||||||
|
)
|
||||||
|
{
|
||||||
|
/// <summary>Convenience count — equals Locations.Count.</summary>
|
||||||
|
public int LocationCount => Locations.Count;
|
||||||
|
}
|
||||||
13
SharepointToolbox/Core/Models/LocationInfo.cs
Normal file
13
SharepointToolbox/Core/Models/LocationInfo.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
namespace SharepointToolbox.Core.Models;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Holds the five location-related fields extracted from a UserAccessEntry
|
||||||
|
/// when permission rows are merged into a consolidated entry.
|
||||||
|
/// </summary>
|
||||||
|
public record LocationInfo(
|
||||||
|
string SiteUrl,
|
||||||
|
string SiteTitle,
|
||||||
|
string ObjectTitle,
|
||||||
|
string ObjectUrl,
|
||||||
|
string ObjectType
|
||||||
|
);
|
||||||
Reference in New Issue
Block a user