Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Core/Resgrid.Config/SecurityConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,19 @@ public static class SecurityConfig
/// Increase this value over time as hardware capabilities improve.
/// </summary>
public static int Pbkdf2Iterations = 600000;

/// <summary>
/// Lifetime, in minutes, of signed anonymous file links (CallFiles/GetFile). Links are
/// regenerated on every authenticated GetFilesForCall response, so a short lifetime only
/// bounds how long a leaked/forwarded URL keeps working. Default 24 hours.
/// </summary>
public static int SignedFileLinkTtlMinutes = 1440;

/// <summary>
/// Accept legacy signed file links that carry no expiry (issued before expiring links
/// shipped). Leave true through a deployment transition, then flip false so every
/// anonymous file link has a bounded lifetime.
/// </summary>
public static bool AllowLegacySignedFileLinks = true;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version='1.0' encoding='utf-8'?>
<?xml version='1.0' encoding='utf-8'?>
<root xmlns:ns1="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:schema id="root">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" />
Expand Down Expand Up @@ -76,6 +76,21 @@
<data name="DeleteTestWarning" xml:space="preserve">
<value>هل أنت متأكد من حذف هذا الاختبار؟</value>
</data>
<data name="NotSentSuppressed" xml:space="preserve">
<value>لم يُرسل (مكتوم)</value>
</data>
<data name="StaffingLevel" xml:space="preserve">
<value>مستوى التوظيف</value>
</data>
<data name="Suppressed" xml:space="preserve">
<value>مكتوم</value>
</data>
<data name="SuppressedHelp" xml:space="preserve">
<value>مستوى التوظيف لهذا العضو مكتوم في إعدادات القسم، لذلك لم يُرسل إليه أي شيء.</value>
</data>
<data name="SuppressedNotice" xml:space="preserve">
<value>لم يتم الاتصال بـ {0} عضو: مستوى التوظيف الخاص بهم مكتوم في إعدادات القسم، لذا لن يصلهم أي إرسال حقيقي أيضًا.</value>
</data>
<data name="TestDefinitions" xml:space="preserve">
<value>تعريفات الاختبار</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version='1.0' encoding='utf-8'?>
<?xml version='1.0' encoding='utf-8'?>
<root xmlns:ns1="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:schema id="root">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" />
Expand Down Expand Up @@ -76,6 +76,21 @@
<data name="DeleteTestWarning" xml:space="preserve">
<value>Möchten Sie diesen Test wirklich löschen?</value>
</data>
<data name="NotSentSuppressed" xml:space="preserve">
<value>Nicht gesendet (unterdrückt)</value>
</data>
<data name="StaffingLevel" xml:space="preserve">
<value>Personalstufe</value>
</data>
<data name="Suppressed" xml:space="preserve">
<value>Unterdrückt</value>
</data>
<data name="SuppressedHelp" xml:space="preserve">
<value>Die Personalstufe dieses Mitglieds ist in Ihren Abteilungseinstellungen stummgeschaltet, daher wurde nichts an ihn gesendet.</value>
</data>
<data name="SuppressedNotice" xml:space="preserve">
<value>{0} Mitglied(er) wurden nicht kontaktiert: Ihre Personalstufe ist in Ihren Abteilungseinstellungen stummgeschaltet, eine echte Alarmierung hätte sie ebenfalls nicht erreicht.</value>
</data>
<data name="TestDefinitions" xml:space="preserve">
<value>Testdefinitionen</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version='1.0' encoding='utf-8'?>
<?xml version='1.0' encoding='utf-8'?>
<root xmlns:ns1="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:schema id="root">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" />
Expand Down Expand Up @@ -76,6 +76,21 @@
<data name="DeleteTestWarning" xml:space="preserve">
<value>Είστε βέβαιοι ότι θέλετε να διαγράψετε αυτή τη δοκιμή;</value>
</data>
<data name="NotSentSuppressed" xml:space="preserve">
<value>Δεν στάλθηκε (σε σίγαση)</value>
</data>
<data name="StaffingLevel" xml:space="preserve">
<value>Επίπεδο στελέχωσης</value>
</data>
<data name="Suppressed" xml:space="preserve">
<value>Σε σίγαση</value>
</data>
<data name="SuppressedHelp" xml:space="preserve">
<value>Το επίπεδο στελέχωσης αυτού του μέλους είναι σε σίγαση στις ρυθμίσεις του τμήματος, επομένως δεν του στάλθηκε τίποτα.</value>
</data>
<data name="SuppressedNotice" xml:space="preserve">
<value>{0} μέλος/μέλη δεν ειδοποιήθηκαν: το επίπεδο στελέχωσής τους είναι σε σίγαση στις ρυθμίσεις του τμήματος, οπότε ούτε μια πραγματική κλήση θα τους έφτανε.</value>
</data>
<data name="TestDefinitions" xml:space="preserve">
<value>Ορισμοί Δοκιμών</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version='1.0' encoding='utf-8'?>
<?xml version='1.0' encoding='utf-8'?>
<root xmlns:ns1="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:schema id="root">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" />
Expand Down Expand Up @@ -76,6 +76,21 @@
<data name="DeleteTestWarning" xml:space="preserve">
<value>Are you sure you want to delete this test?</value>
</data>
<data name="NotSentSuppressed" xml:space="preserve">
<value>Not Sent (Suppressed)</value>
</data>
<data name="StaffingLevel" xml:space="preserve">
<value>Staffing Level</value>
</data>
<data name="Suppressed" xml:space="preserve">
<value>Suppressed</value>
</data>
<data name="SuppressedHelp" xml:space="preserve">
<value>This member's staffing level is muted in your department settings, so nothing was sent to them.</value>
</data>
<data name="SuppressedNotice" xml:space="preserve">
<value>{0} member(s) were not contacted: their staffing level is muted in your department settings, so a real dispatch would not have reached them either.</value>
</data>
<data name="TestDefinitions" xml:space="preserve">
<value>Test Definitions</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version='1.0' encoding='utf-8'?>
<?xml version='1.0' encoding='utf-8'?>
<root xmlns:ns1="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:schema id="root">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" />
Expand Down Expand Up @@ -76,6 +76,21 @@
<data name="DeleteTestWarning" xml:space="preserve">
<value>¿Seguro que desea eliminar esta prueba?</value>
</data>
<data name="NotSentSuppressed" xml:space="preserve">
<value>No enviado (suprimido)</value>
</data>
<data name="StaffingLevel" xml:space="preserve">
<value>Nivel de personal</value>
</data>
<data name="Suppressed" xml:space="preserve">
<value>Suprimido</value>
</data>
<data name="SuppressedHelp" xml:space="preserve">
<value>El nivel de personal de este miembro está silenciado en la configuración de su departamento, por lo que no se le envió nada.</value>
</data>
<data name="SuppressedNotice" xml:space="preserve">
<value>{0} miembro(s) no fueron contactados: su nivel de personal está silenciado en la configuración de su departamento, por lo que un despacho real tampoco les habría llegado.</value>
</data>
<data name="TestDefinitions" xml:space="preserve">
<value>Definiciones de prueba</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version='1.0' encoding='utf-8'?>
<?xml version='1.0' encoding='utf-8'?>
<root xmlns:ns1="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:schema id="root">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" />
Expand Down Expand Up @@ -76,6 +76,21 @@
<data name="DeleteTestWarning" xml:space="preserve">
<value>Voulez-vous vraiment supprimer ce test ?</value>
</data>
<data name="NotSentSuppressed" xml:space="preserve">
<value>Non envoyé (supprimé)</value>
</data>
<data name="StaffingLevel" xml:space="preserve">
<value>Niveau d'effectif</value>
</data>
<data name="Suppressed" xml:space="preserve">
<value>Supprimé</value>
</data>
<data name="SuppressedHelp" xml:space="preserve">
<value>Le niveau d'effectif de ce membre est désactivé dans les paramètres de votre département, aucun message ne lui a donc été envoyé.</value>
</data>
<data name="SuppressedNotice" xml:space="preserve">
<value>{0} membre(s) n'ont pas été contactés : leur niveau d'effectif est désactivé dans les paramètres de votre département, une véritable alerte ne les aurait pas atteints non plus.</value>
</data>
<data name="TestDefinitions" xml:space="preserve">
<value>Définitions des tests</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version='1.0' encoding='utf-8'?>
<?xml version='1.0' encoding='utf-8'?>
<root xmlns:ns1="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:schema id="root">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" />
Expand Down Expand Up @@ -76,6 +76,21 @@
<data name="DeleteTestWarning" xml:space="preserve">
<value>Vuoi davvero eliminare questo test?</value>
</data>
<data name="NotSentSuppressed" xml:space="preserve">
<value>Non inviato (soppresso)</value>
</data>
<data name="StaffingLevel" xml:space="preserve">
<value>Livello di personale</value>
</data>
<data name="Suppressed" xml:space="preserve">
<value>Soppresso</value>
</data>
<data name="SuppressedHelp" xml:space="preserve">
<value>Il livello di personale di questo membro è silenziato nelle impostazioni del dipartimento, quindi non gli è stato inviato nulla.</value>
</data>
<data name="SuppressedNotice" xml:space="preserve">
<value>{0} membro/i non sono stati contattati: il loro livello di personale è silenziato nelle impostazioni del dipartimento, quindi nemmeno un invio reale li avrebbe raggiunti.</value>
</data>
<data name="TestDefinitions" xml:space="preserve">
<value>Definizioni dei test</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version='1.0' encoding='utf-8'?>
<?xml version='1.0' encoding='utf-8'?>
<root xmlns:ns1="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:schema id="root">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" />
Expand Down Expand Up @@ -76,6 +76,21 @@
<data name="DeleteTestWarning" xml:space="preserve">
<value>Czy na pewno chcesz usunąć ten test?</value>
</data>
<data name="NotSentSuppressed" xml:space="preserve">
<value>Nie wysłano (wyciszone)</value>
</data>
<data name="StaffingLevel" xml:space="preserve">
<value>Poziom obsady</value>
</data>
<data name="Suppressed" xml:space="preserve">
<value>Wyciszony</value>
</data>
<data name="SuppressedHelp" xml:space="preserve">
<value>Poziom obsady tego członka jest wyciszony w ustawieniach jednostki, więc nic do niego nie wysłano.</value>
</data>
<data name="SuppressedNotice" xml:space="preserve">
<value>{0} członk(ów) nie zostało powiadomionych: ich poziom obsady jest wyciszony w ustawieniach jednostki, więc prawdziwe zadysponowanie również by ich nie dotarło.</value>
</data>
<data name="TestDefinitions" xml:space="preserve">
<value>Definicje testów</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version='1.0' encoding='utf-8'?>
<?xml version='1.0' encoding='utf-8'?>
<root xmlns:ns1="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:schema id="root">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" />
Expand Down Expand Up @@ -76,6 +76,21 @@
<data name="DeleteTestWarning" xml:space="preserve">
<value>Är du säker på att du vill ta bort detta test?</value>
</data>
<data name="NotSentSuppressed" xml:space="preserve">
<value>Ej skickat (tystad)</value>
</data>
<data name="StaffingLevel" xml:space="preserve">
<value>Bemanningsnivå</value>
</data>
<data name="Suppressed" xml:space="preserve">
<value>Tystad</value>
</data>
<data name="SuppressedHelp" xml:space="preserve">
<value>Den här medlemmens bemanningsnivå är tystad i era avdelningsinställningar, därför skickades ingenting till dem.</value>
</data>
<data name="SuppressedNotice" xml:space="preserve">
<value>{0} medlem(mar) kontaktades inte: deras bemanningsnivå är tystad i era avdelningsinställningar, så ett riktigt larm hade inte heller nått dem.</value>
</data>
<data name="TestDefinitions" xml:space="preserve">
<value>Testdefinitioner</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version='1.0' encoding='utf-8'?>
<?xml version='1.0' encoding='utf-8'?>
<root xmlns:ns1="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:schema id="root">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" />
Expand Down Expand Up @@ -76,6 +76,21 @@
<data name="DeleteTestWarning" xml:space="preserve">
<value>Ви впевнені, що хочете видалити цей тест?</value>
</data>
<data name="NotSentSuppressed" xml:space="preserve">
<value>Не надіслано (приглушено)</value>
</data>
<data name="StaffingLevel" xml:space="preserve">
<value>Рівень укомплектованості</value>
</data>
<data name="Suppressed" xml:space="preserve">
<value>Приглушено</value>
</data>
<data name="SuppressedHelp" xml:space="preserve">
<value>Рівень укомплектованості цього користувача приглушено в налаштуваннях підрозділу, тому йому нічого не надсилали.</value>
</data>
<data name="SuppressedNotice" xml:space="preserve">
<value>{0} користувач(ів) не отримали повідомлень: їхній рівень укомплектованості приглушено в налаштуваннях підрозділу, тож справжнє сповіщення теж би до них не дійшло.</value>
</data>
<data name="TestDefinitions" xml:space="preserve">
<value>Визначення тестів</value>
</data>
Expand Down
32 changes: 31 additions & 1 deletion Core/Resgrid.Model/CommunicationTestResult.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
Expand Down Expand Up @@ -37,6 +37,36 @@ public class CommunicationTestResult : IEntity

public int VerificationStatus { get; set; }

/// <summary>
/// Whether the member had this channel switched on in their own notification settings when
/// the run was built. Recorded on the row rather than read back off the live profile so the
/// report describes the run as it happened -- a member who turns SMS on the day after a test
/// must not make that run look like it should have texted them. NULL on runs built before
/// this was recorded; the report falls back to the current profile for those.
/// </summary>
public bool? ChannelEnabled { get; set; }

/// <summary>
/// The member's staffing level (their last UserState) when the run was built, or NULL when
/// they had never set one. Stored with <see cref="StaffingLevelText"/> so a report read
/// months later still shows the level the run actually saw.
/// </summary>
public int? StaffingLevel { get; set; }

/// <summary>
/// Display name of <see cref="StaffingLevel"/> as the department had it configured at run
/// time. Snapshotted because a department can rename or delete a custom staffing level.
/// </summary>
[MaxLength(50)]
public string StaffingLevelText { get; set; }

/// <summary>
/// Whether the department's Suppress (Mute) Staffing Levels setting muted this member for
/// this run. Suppressed rows are still written and still reported -- the point of the report
/// is to show who a real dispatch would and would not reach -- but nothing is sent to them.
/// </summary>
public bool Suppressed { get; set; }

public bool SendAttempted { get; set; }

public bool SendSucceeded { get; set; }
Expand Down
29 changes: 28 additions & 1 deletion Core/Resgrid.Model/CommunicationTestResultExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Resgrid.Model
namespace Resgrid.Model
{
/// <summary>
/// Presentation helpers for communication test results. These live here rather than in a view so
Expand Down Expand Up @@ -32,5 +32,32 @@ public static bool HasVerifiableContactMethod(this CommunicationTestResult resul
{
return result != null && result.Channel != (int)CommunicationTestChannel.Push;
}

/// <summary>
/// Label for the staffing level the member was on when the run was built: the name the
/// department had configured at the time, the raw level when a run predates that snapshot or
/// the level has since been deleted, and "-" when the member had never set one.
/// </summary>
public static string GetStaffingLevelDisplayText(this CommunicationTestResult result)
{
if (result == null)
return "-";

if (!string.IsNullOrWhiteSpace(result.StaffingLevelText))
return result.StaffingLevelText;

return result.StaffingLevel.HasValue ? result.StaffingLevel.Value.ToString() : "-";
}

/// <summary>
/// The member's own on/off election for this channel. Falls back to <paramref name="liveValue"/>
/// -- what their profile says right now -- only for runs built before the election was
/// recorded, so an older report reads as unknown-but-plausible rather than claiming every
/// channel in it was switched off.
/// </summary>
public static bool GetChannelElection(this CommunicationTestResult result, bool liveValue)
{
return result?.ChannelEnabled ?? liveValue;
}
}
}
10 changes: 10 additions & 0 deletions Core/Resgrid.Model/ProtectedDataEnvelope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ public static class ProtectedDataEnvelope
/// </summary>
public const string RedactionValue = "REDACTED";

/// <summary>
/// Display form for surfaces with no reveal pipeline (server-rendered lists, exports,
/// projections): an enveloped value renders as the REDACTED placeholder, anything else
/// passes through. Ciphertext must never reach a page, grid payload, or document.
/// </summary>
public static string SafeDisplay(string value)
{
return HasEnvelopePrefix(value) ? RedactionValue : value;
}

/// <summary>True when the value starts with either envelope prefix (cheap pre-check).</summary>
public static bool HasEnvelopePrefix(string value)
{
Expand Down
Loading
Loading