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;
2using System.Threading.Tasks;
4
6{
10 [CollectionName("Privileges")]
11 [TypeName(TypeNameSerialization.None)]
12 [Index("LocalId", "ParentFullId")]
13 [Index("ParentFullId", "LocalId")]
14 [Index("FullId")]
15 [ArchivingTime]
16 public class Privilege
17 {
18 private string objectId = null;
19 private string parentFullId = string.Empty;
20 private string localId = string.Empty;
21 private string fullId = string.Empty;
22 private string description = string.Empty;
23 private Privilege parent = null;
24
28 public Privilege()
29 {
30 }
31
35 [ObjectId]
36 public string ObjectId
37 {
38 get => this.objectId;
39 set => this.objectId = value;
40 }
41
45 public string ParentFullId
46 {
47 get => this.parentFullId;
48 set => this.parentFullId = value;
49 }
50
54 public string LocalId
55 {
56 get => this.localId;
57 set => this.localId = value;
58 }
59
63 public string FullId
64 {
65 get => this.fullId;
66 set => this.fullId = value;
67 }
68
72 [DefaultValueStringEmpty]
73 public string Description
74 {
75 get => this.description;
76 set => this.description = value;
77 }
78
82 [IgnoreMember]
84 {
85 get
86 {
87 if (this.parent is null && !string.IsNullOrEmpty(this.parentFullId))
88 this.parent = Privileges.GetPrivilege(this.parentFullId).Result;
89
90 return this.parent;
91 }
92
93 internal set => this.parent = value;
94 }
95 }
96}
Corresponds to a privilege in the system.
Definition: Privilege.cs:17
Privilege Parent
Parent privilege.
Definition: Privilege.cs:84
Privilege()
Corresponds to a privilege in the system.
Definition: Privilege.cs:28
string ObjectId
Object ID of privilege
Definition: Privilege.cs:37
string ParentFullId
Full Privilege ID of parent privilege. If the empty string, privilege is a root privilege.
Definition: Privilege.cs:46
string Description
Description of privilege.
Definition: Privilege.cs:74
string LocalId
Local Privilege ID, unique among the child privileges of the same parent.
Definition: Privilege.cs:55
string FullId
Full Privilege ID. Corresponds to the concatenation of ancestor IDs with the local ID,...
Definition: Privilege.cs:64
Maintains the collection of all privileges in the system.
Definition: Privileges.cs:14
static async Task< Privilege > GetPrivilege(string PrivilegeId)
Gets the Privilege object corresponding to a full Privilege ID.
Definition: Privileges.cs:24
TypeNameSerialization
How the type name should be serialized.