/// <summary> /// This constructor is used for deserialization. /// </summary> /// <param name="info"></param> /// <param name="context"></param> private VLAccessDeniedException(SerializationInfo info, StreamingContext context) : base(info, context) { this.m_OkIfOneSetExists = info.GetBoolean("OkIfOneSetExists"); this.m_requiredPermissions = (VLPermissions)info.GetValue("requiredPermissions", typeof(VLPermissions)); this.m_requiredPermissionsArray = (VLPermissions[])info.GetValue("requiredPermissionsArray", typeof(VLPermissions[])); }
/// <summary> /// /// </summary> internal VLRole() { m_roleId = default(Int16); m_name = default(string); m_description = default(string); m_permissions = default(Int64); m_isBuiltIn = default(Boolean); m_isClientRole = default(Boolean); }
/// <summary> /// /// </summary> /// <param name="reader"></param> internal UserPassword(DbDataReader reader) : this() { this.Principal = reader.GetInt32(0); this.PrincipalType = (PrincipalType)reader.GetByte(1); if (!reader.IsDBNull(2)) { this.IsBuiltin = reader.GetBoolean(2); } if (!reader.IsDBNull(3)) { this.IsActive = reader.GetBoolean(3); } this.IsApproved = reader.GetBoolean(4); this.IsLockedOut = reader.GetBoolean(5); if (!reader.IsDBNull(6)) { this.PswdFromDB = reader.GetString(6); } if (!reader.IsDBNull(7)) { this.PswdSalt = reader.GetString(7); } this.PswdFormat = (VLPasswordFormat)reader.GetInt32(8); if (!reader.IsDBNull(9)) { this.IPAddress = reader.GetString(9); } this.FailedPasswordAttemptCount = reader.GetInt32(10); this.FailedPasswordAnswerAttemptCount = reader.GetInt32(11); if (!reader.IsDBNull(12)) { this.LastLoginDate = reader.GetDateTime(12); } if (!reader.IsDBNull(13)) { this.LastActivityDate = reader.GetDateTime(13); } if (!reader.IsDBNull(14)) { this.MaxInvalidPasswordAttempts = reader.GetInt32(14); } if (!reader.IsDBNull(15)) { this.PasswordAttemptWindow = reader.GetInt32(15); } if (!reader.IsDBNull(16)) { this.Permissions = (VLPermissions)reader.GetInt64(16); } }
/// <summary> /// Specifies whether this particular access token, has the required permissions. /// </summary> /// <param name="requiredPermissions"></param> /// <returns></returns> public bool HasPermissions(VLPermissions requiredPermissions) { return((requiredPermissions & this.Permissions) == requiredPermissions); }
/// <summary> /// /// </summary> /// <param name="requiredPermissions"></param> /// <param name="message"></param> public VLAccessDeniedException(VLPermissions requiredPermissions, string message) : base(message) { m_requiredPermissions = requiredPermissions; }
/// <summary> /// /// </summary> /// <param name="requiredPermissions"></param> public VLAccessDeniedException(VLPermissions requiredPermissions) : base("Access denied.") { m_requiredPermissions = requiredPermissions; }