35 User = user ??
throw new ArgumentNullException(nameof(user));
37 throw new ArgumentNullException(nameof(systemIdentity));
39 SystemIdentity = systemIdentity;
43 public void Dispose() => SystemIdentity?.Dispose();
51 throw new InvalidOperationException(
"Authentication context has no user!");
60 var nullableType = typeof(Nullable<>);
61 var nullableRightsType = nullableType.MakeGenericType(rightsEnum);
63 var prop = typeToCheck.GetProperties().Where(x => x.PropertyType == nullableRightsType).First();
65 var right = prop.GetMethod.Invoke(isInstance ? (
object)
InstanceUser :
User, Array.Empty<
object>());
68 throw new InvalidOperationException(
"A user right was null!");
static bool IsInstanceRight(RightsType rightsType)
Check if a given rightsType is meant for an Models.Instance
AuthenticationContext(ISystemIdentity systemIdentity, User user, InstanceUser instanceUser)
Construct an AuthenticationContext
Manages Api.Models.Users for a scope
AuthenticationContext()
Construct an empty AuthenticationContext
RightsType
The type of rights a model uses
Represents a user on the current global::System.Runtime.InteropServices.OSPlatform ...
Represents the currently authenticated Api.Models.User
ulong GetRight(RightsType rightsType)
Get the value of a given rightsType
static Type RightToType(RightsType rightsType)
Map a given rightsType to its respective Enum Type
string SystemIdentifier
The SID/UID of the User on Windows/POSIX respectively