public User(Credentials credentials, AuthenticationToken token, string name, Rights rights) : this(credentials, token, UserStatus.User, name, null, rights) { }
public User(Credentials credentials, AuthenticationToken token, UserStatus status, string name, string descr, Rights rights) { m_Credentials = credentials; m_AuthenticationToken = token; m_Status = status; m_Name = name; m_Description = descr; m_Rights = rights; }
} //for quicker serialization public User(Credentials credentials, AuthenticationToken token, UserStatus status, string name, string descr, Rights rights) { m_Credentials = credentials; m_AuthenticationToken = token; m_Status = status; m_Name = name; m_Description = descr; m_Rights = rights; m_StatusTimeStampUTC = App.TimeSource.UTCNow; }
/// <summary> /// Framework-internal. Do not call /// </summary> public void ___update_status( UserStatus status, string name, string descr, Rights rights) { if (object.ReferenceEquals(this, s_FakeUserInstance)) { return; //Fake user is immutable } m_Status = status; m_Name = name; m_Description = descr; m_Rights = rights; m_StatusTimeStampUTC = App.TimeSource.UTCNow; }
public User Authenticate(Credentials credentials) { var sect = m_Config ?? App.ConfigRoot[CommonApplicationLogic.CONFIG_SECURITY_SECTION]; if (sect.Exists && credentials is IDPasswordCredentials) { var idpass = (IDPasswordCredentials)credentials; var usern = findUserNode(sect, idpass); if (usern.Exists) { var name = usern.AttrByName(CONFIG_NAME_ATTR).ValueAsString(string.Empty); var descr = usern.AttrByName(CONFIG_DESCRIPTION_ATTR).ValueAsString(string.Empty); var status = usern.AttrByName(CONFIG_STATUS_ATTR).ValueAsEnum <UserStatus>(UserStatus.Invalid); var rights = Rights.None; var rightsn = usern[CONFIG_RIGHTS_SECTION]; if (rightsn.Exists) { var data = new MemoryConfiguration(); data.CreateFromNode(rightsn); rights = new Rights(data); } return(new User(credentials, credToAuthToken(idpass), status, name, descr, rights)); } } return(new User(credentials, new AuthenticationToken(), UserStatus.Invalid, StringConsts.SECURITY_NON_AUTHENTICATED, StringConsts.SECURITY_NON_AUTHENTICATED, Rights.None)); }
/// <summary> /// Framework-internal. Do not call /// </summary> public void ___update_status( UserStatus status, string name, string descr, Rights rights) { if (object.ReferenceEquals(this, s_FakeUserInstance)) return;//Fake user is immutable m_Status = status; m_Name = name; m_Description = descr; m_Rights = rights; m_StatusTimeStampUTC = App.TimeSource.UTCNow; }
public User Authenticate(Credentials credentials) { var sect = m_Config ?? App.ConfigRoot[CommonApplicationLogic.CONFIG_SECURITY_SECTION]; if (sect.Exists && credentials is IDPasswordCredentials) { var idpass = (IDPasswordCredentials)credentials; var usern = findUserNode(sect, idpass); if (usern.Exists) { var name = usern.AttrByName(CONFIG_NAME_ATTR).ValueAsString(string.Empty); var descr = usern.AttrByName(CONFIG_DESCRIPTION_ATTR).ValueAsString(string.Empty); var status = usern.AttrByName(CONFIG_STATUS_ATTR).ValueAsEnum<UserStatus>(UserStatus.Invalid); var rights = Rights.None; var rightsn = usern[CONFIG_RIGHTS_SECTION]; if (rightsn.Exists) { var data = new MemoryConfiguration(); data.CreateFromNode(rightsn); rights = new Rights(data); } return new User(credentials, credToAuthToken(idpass), status, name, descr, rights); } } return new User(credentials, new AuthenticationToken(), UserStatus.Invalid, StringConsts.SECURITY_NON_AUTHENTICATED, StringConsts.SECURITY_NON_AUTHENTICATED, Rights.None); }
/// <summary> /// Framework-internal. Do not call /// </summary> public void ___reset_data( UserStatus status, string name, string descr, Rights rights) { m_Status = status; m_Name = name; m_Description = descr; m_Rights = rights; }