Show / Hide Table of Contents

Class User

Provides base user functionality. Particular security manager implementations may return users derived from this class

Inheritance
System.Object
User
Implements
IIdentityDescriptor
System.Security.Principal.IIdentity
System.Security.Principal.IPrincipal
System.Runtime.Serialization.IDeserializationCallback
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: NFX.Security
Assembly: NFX.dll
Syntax
[Serializable]
public class User : IIdentityDescriptor, IIdentity, IPrincipal, IDeserializationCallback

Constructors

User(Credentials, AuthenticationToken, UserStatus, String, String, Rights)

Declaration
public User(Credentials credentials, AuthenticationToken token, UserStatus status, string name, string descr, Rights rights)
Parameters
Type Name Description
Credentials credentials
AuthenticationToken token
UserStatus status
System.String name
System.String descr
Rights rights

User(Credentials, AuthenticationToken, String, Rights)

Declaration
public User(Credentials credentials, AuthenticationToken token, string name, Rights rights)
Parameters
Type Name Description
Credentials credentials
AuthenticationToken token
System.String name
Rights rights

Properties

AuthenticationType

Implementation of IIdentity interface

Declaration
public string AuthenticationType { get; }
Property Value
Type Description
System.String

AuthToken

Declaration
public AuthenticationToken AuthToken { get; }
Property Value
Type Description
AuthenticationToken

Credentials

Declaration
public Credentials Credentials { get; }
Property Value
Type Description
Credentials

Description

Declaration
public string Description { get; }
Property Value
Type Description
System.String

Fake

Returns default instance of the fake user that has no rights

Declaration
public static User Fake { get; }
Property Value
Type Description
User

Identity

Implementation of IPrincipal interface

Declaration
public IIdentity Identity { get; }
Property Value
Type Description
System.Security.Principal.IIdentity

IdentityDescriptorID

Declaration
public virtual object IdentityDescriptorID { get; }
Property Value
Type Description
System.Object

IdentityDescriptorName

Declaration
public virtual string IdentityDescriptorName { get; }
Property Value
Type Description
System.String

IdentityDescriptorType

Declaration
public virtual IdentityType IdentityDescriptorType { get; }
Property Value
Type Description
IdentityType

IsAuthenticated

Implementation of IIdentity interface. Checks to see if user is not in invalid status

Declaration
public bool IsAuthenticated { get; }
Property Value
Type Description
System.Boolean

Item[Permission]

Authorizes user to specified permission. Note: this authorization call returns AccessLevel object that may contain a complex data structure. The final assertion of user's ability to perform a certain action is encapsulated in Permission.Check() method. Call Permission.AuthorizeAndGuardAction(MemberInfo, ISession) to guard classes and methods from unauthorized access

Declaration
public AccessLevel this[Permission permission] { get; }
Parameters
Type Name Description
Permission permission
Property Value
Type Description
AccessLevel

Name

Declaration
public string Name { get; }
Property Value
Type Description
System.String

Rights

Returns data bag that contains user rights. This is a framework-only internal property which should not be used by application developers. This bag may get populated fully-or-partially by ISecurityManager implementation. Use User[permission] indexer or Application.SecurityManager.Authorize() to obtain AccessLevel

Declaration
public Rights Rights { get; }
Property Value
Type Description
Rights

Status

Declaration
public UserStatus Status { get; }
Property Value
Type Description
UserStatus

StatusTimeStampUTC

Captures timestamp when this user was set to current status (created/set rights) Security managers may elect to reftech user rights after some period

Declaration
public DateTime StatusTimeStampUTC { get; }
Property Value
Type Description
System.DateTime

Methods

___update_status(UserStatus, String, String, Rights)

Framework-internal. Do not call

Declaration
public void ___update_status(UserStatus status, string name, string descr, Rights rights)
Parameters
Type Name Description
UserStatus status
System.String name
System.String descr
Rights rights

Invalidate()

Makes user invalid

Declaration
public void Invalidate()

IsInRole(String)

Determines whether the current principal belongs to the specified role. This method implements IPrincipal and has little application in NFX framework context as NFX permissions are more granular than just boolean. This method really checks user kind (User/Admin/Sys). Confusion comes from the fact that what Microsoft calls role really is just a single named permission - a role is a named permission set in NFX.

Declaration
public bool IsInRole(string role)
Parameters
Type Name Description
System.String role
Returns
Type Description
System.Boolean

OnDeserialization(Object)

Declaration
public void OnDeserialization(object sender)
Parameters
Type Name Description
System.Object sender

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()

Implements

IIdentityDescriptor
System.Security.Principal.IIdentity
System.Security.Principal.IPrincipal
System.Runtime.Serialization.IDeserializationCallback

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX