forked from danieldantasdev/DesignPatternsInUse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
16 lines (13 loc) · 724 Bytes
/
Program.cs
File metadata and controls
16 lines (13 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* In this example, the SecureDocumentAccessorProxy acts as a protective proxy.
* It enforces access control checks and logs document access attempts,
* providing a secure way to manage sensitive information.
* This approach is common in systems where security and auditability are crucial,
* such as financial, medical, or legal information systems. */
string userId = "user123"; // Simulate a user ID
string documentId = "doc456"; // Simulate a document ID
IDocumentAccessor documentAccessor = new SecureDocumentAccessorProxy(userId);
string? documentContent = documentAccessor.FetchDocument(documentId);
if (documentContent != null)
{
Console.WriteLine($"Fetched document content: {documentContent}");
}