š SystemAccessList Class Documentation
š Table of Contents
- Overview & Purpose
- Dependencies & Technologies
- Class Diagram (UML)
- Key Functional Areas
- Properties Reference
- Sample Code & Usage Examples
- Integration in a UI / ViewModel Scenario
- Error Handling & Return Types
- Conclusion
š§ Overview & Purpose
The SystemAccessList class is a simple Data Model (POCO) used in the IrbyImaging UI layer. Its main role is to aggregate and transport detailed accessācontrol information across the applicationās front end, combining:
- Permissions (what operations are allowed),
- Roles (predefined sets of permissions),
- Employees (users assigned roles),
- Departments, and
- AdāHoc Roles (temporary or specific assignment roles).
This unified model simplifies rendering user access lists in dashboards, grids, or reports within a WPF or ASP.NET MVC/Blazor UI.
š ļø Dependencies & Technologies
- Language: C#
- Platform: .NET (Core / Framework)
- Namespace:
IrbyImaging.UI.Models - Assemblies:
System(forGuidsupport)
No external NuGet packages or 3rdāparty integrations are directly referenced in this model.
š Class Diagram (UML)
classDiagram
class SystemAccessList {
+Guid PermissionId
+string PermissionName
+string PermissionDescription
+Guid? RoleId
+string RoleName
+string RoleDescription
+Guid EmployeeId
+string EmployeeName
+Guid? EmployeeRoleId
+Guid? DepartmentId
+string DepartmentName
+Guid AdHocRoleId
+string AdHocRoleName
+string AdHocRoleDescription
}
š Key Functional Areas
-
Permission Details
- Stores unique PermissionId, humanāreadable Name, and a Description.
-
Role Assignment
- Captures the userās Role via an optional
RoleId, its Name, and Description.
- Captures the userās Role via an optional
-
Employee Context
- Links to the EmployeeId (mandatory), Name, and any existing EmployeeRoleId.
-
Department Association
- Optionally ties an employee to a DepartmentId with its Name.
-
AdāHoc Role Handling
- Separately tracks a special AdHocRoleId, Name, and Description to handle temporary or situational roles.
š Properties Reference
| Property Name | Type | Nullable | Description |
|---|---|---|---|
| PermissionId | Guid |
No | Unique ID of the permission. |
| PermissionName | string |
No | Humanāreadable name of the permission. |
| PermissionDescription | string |
No | Detailed info about what the permission allows. |
| RoleId | Guid? |
Yes | Optional ID of the role assigned to the user. |
| RoleName | string |
No | Roleās display name. |
| RoleDescription | string |
No | Summary of roleās responsibilities. |
| EmployeeId | Guid |
No | Unique ID for the employee. |
| EmployeeName | string |
No | Full name of the employee. |
| EmployeeRoleId | Guid? |
Yes | Specific role ID held by the employee (if any). |
| DepartmentId | Guid? |
Yes | ID of the department the employee belongs to. |
| DepartmentName | string |
No | Name of that department. |
| AdHocRoleId | Guid |
No | Unique ID for the adāhoc role. |
| AdHocRoleName | string |
No | Display name of the adāhoc role. |
| AdHocRoleDescription | string |
No | Details/notes about this adāhoc role assignment. |
š» Sample Code & Usage Examples
Instantiating & Populating
using IrbyImaging.UI.Models;
var access = new SystemAccessList {
PermissionId = Guid.NewGuid(),
PermissionName = "EditImages",
PermissionDescription = "Allows user to modify image properties.",
RoleId = Guid.Parse("a1b2c3d4-e5f6-7a8b-9c0d-e1f2a3b4c5d6"),
RoleName = "ImageEditor",
RoleDescription = "Can edit and delete images.",
EmployeeId = Guid.Parse("11111111-2222-3333-4444-555555555555"),
EmployeeName = "Jane Doe",
EmployeeRoleId = Guid.Parse("a1b2c3d4-e5f6-7a8b-9c0d-e1f2a3b4c5d6"),
DepartmentId = Guid.Parse("66666666-7777-8888-9999-000000000000"),
DepartmentName = "Imaging Department",
AdHocRoleId = Guid.NewGuid(),
AdHocRoleName = "EmergencyAccess",
AdHocRoleDescription = "Temporary elevated access during an outage."
};
Rendering in a Razor View (ASP.NET MVC / Blazor)
<table class="table">
<thead>
<tr>
<th>Employee</th><th>Role</th><th>Permission</th><th>Dept.</th><th>Ad-Hoc Role</th>
</tr>
</thead>
<tbody>
@foreach(var item in Model.SystemAccessLists) {
<tr>
<td>@item.EmployeeName</td>
<td>@item.RoleName</td>
<td>@item.PermissionName</td>
<td>@item.DepartmentName</td>
<td>@item.AdHocRoleName</td>
</tr>
}
</tbody>
</table>
š Integration in a UI / ViewModel Scenario
-
Controller / ViewModel
- Query your data store for permissions, roles, employees, etc.
- Map results into a list of
SystemAccessList.
-
Binding to View
- Pass the list as a model or part of a larger view model.
- The frontāend uses the properties to display a comprehensive access matrix.
-
Filtering & Sorting
- Use LINQ on
IEnumerable<SystemAccessList>for clientāside filtering (by department, role, etc.).
- Use LINQ on
ā ļø Error Handling & Return Types
- This model has no methods; error handling is managed upstream.
- Nullability on
Guid?fields enables safe absence of data (e.g., noRoleIdmeans no role assigned). - When consuming:
- Always check for
nullon optional fields. - Wrap view rendering in guards to avoid nullāreference issues.
- Always check for
ā Conclusion
The SystemAccessList class is a versatile, flat DTO that unifies multiple aspects of systemāaccess data for UI rendering. It is:
- Easy to Map from database records or domain entities
- Lightweight and Frameworkāagnostic
- Ideal for displaying userāpermission matrices, audit logs, or administrative dashboards
With this model in place, you can rapidly implement comprehensive access management views in any .NET web or desktop UI. Enjoy building your next accessācontrol feature! š
Generated by IrbyImaging Documentation Generator