Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Privilege.cs
1using System;
3
5{
9 [CollectionName("Privileges")]
10 [TypeName(TypeNameSerialization.None)]
11 [Index("LocalId", "ParentFullId")]
12 [Index("ParentFullId", "LocalId")]
13 [Index("FullId")]
14 [ArchivingTime]
15 public class Privilege
16 {
17 private string objectId = null;
18 private string parentFullId = string.Empty;
19 private string localId = string.Empty;
20 private string fullId = string.Empty;
21 private string description = string.Empty;
22 private Privilege parent = null;
23
27 public Privilege()
28 {
29 }
30
34 [ObjectId]
35 public string ObjectId
36 {
37 get => this.objectId;
38 set => this.objectId = value;
39 }
40
44 public string ParentFullId
45 {
46 get => this.parentFullId;
47 set => this.parentFullId = value;
48 }
49
53 public string LocalId
54 {
55 get => this.localId;
56 set => this.localId = value;
57 }
58
62 public string FullId
63 {
64 get => this.fullId;
65 set => this.fullId = value;
66 }
67
71 [DefaultValueStringEmpty]
72 public string Description
73 {
74 get => this.description;
75 set => this.description = value;
76 }
77
81 [IgnoreMember]
83 {
84 get
85 {
86 if (this.parent is null && !string.IsNullOrEmpty(this.parentFullId))
87 this.parent = Privileges.GetPrivilege(this.parentFullId).Result;
88
89 return this.parent;
90 }
91
92 internal set => this.parent = value;
93 }
94 }
95}
Corresponds to a privilege in the system.
Definition: Privilege.cs:16
Privilege Parent
Parent privilege.
Definition: Privilege.cs:83
Privilege()
Corresponds to a privilege in the system.
Definition: Privilege.cs:27
string ObjectId
Object ID of privilege
Definition: Privilege.cs:36
string ParentFullId
Full Privilege ID of parent privilege. If the empty string, privilege is a root privilege.
Definition: Privilege.cs:45
string Description
Description of privilege.
Definition: Privilege.cs:73
string LocalId
Local Privilege ID, unique among the child privileges of the same parent.
Definition: Privilege.cs:54
string FullId
Full Privilege ID. Corresponds to the concatenation of ancestor IDs with the local ID,...
Definition: Privilege.cs:63
Maintains the collection of all privileges in the system.
Definition: Privileges.cs:13
static async Task< Privilege > GetPrivilege(string PrivilegeId)
Gets the Privilege object corresponding to a full Privilege ID.
Definition: Privileges.cs:23
TypeNameSerialization
How the type name should be serialized.