Table of Contents

Class PermissionReflectionScanner

Namespace
KadicAuth.Application.Permissions.Seeding
Assembly
KadicAuth.Application.dll

Walks the KadicErp.Core.Abstractions.Authorization.Permissions static class by reflection and converts every nested submodule / constant into a PermissionSeedEntry.

Convention: - Top-level nested class (e.g. Permissions.RentACar) = module. - Second-level nested class (e.g. Permissions.RentACar.RentalTypes) = submodule. - public const string members inside a submodule class = permission codes.

The ModuleKeyMap resolves top-level class names to the ModuleKey stored in Auth.Modules. Classes not in the map are skipped silently so this seeder can roll out gradually without needing every historical module mapped on day one.

public static class PermissionReflectionScanner
Inheritance
object
PermissionReflectionScanner

Fields

ModuleKeyMap

Maps the C# class name under KadicErp.Core.Abstractions.Authorization.Permissions to the ModuleKey expected in Auth.Modules. Extend when a new module comes online.

public static readonly IReadOnlyDictionary<string, string> ModuleKeyMap

Field Value

IReadOnlyDictionary<string, string>

Methods

ScanAll()

Produces the full list of permissions declared in KadicErp.Core.Abstractions.Authorization.Permissions grouped by their mapped module key.

public static List<PermissionSeedEntry> ScanAll()

Returns

List<PermissionSeedEntry>