Skip to main content

Security & Permissions

The Security module manages department-wide permissions and provides access to audit logs. It is managed by the SecurityController.

Admin Only

All write operations in this module require department administrator status, checked via ClaimsAuthorizationHelper.IsUserDepartmentAdmin().

Permission Configuration

Available Permissions

The system manages approximately 20 permission types:

PermissionDescription
AddPersonnelWho can add new personnel
RemovePersonnelWho can remove personnel
CreateCallWho can create dispatch calls
CreateTrainingWho can create trainings
CreateDocumentWho can upload documents
CreateCalendarEntryWho can create calendar events
CreateNoteWho can create notes
CreateLogWho can create work logs
CreateShiftWho can create shifts
ViewPersonalInfoWho can view PII (email, phone)
AdjustInventoryWho can adjust inventory
ViewPersonnelLocationWho can see personnel GPS locations
ViewUnitLocationWho can see unit GPS locations
CreateMessageWho can send messages
ViewGroupUsersWho can see users in groups
DeleteCallWho can delete calls
CloseCallWho can close calls
AddCallDataWho can add data to calls
ViewGroupUnitsWho can see units in groups
ViewContactsWho can view contacts
EditContactsWho can edit contacts
DeleteContactsWho can delete contacts

Permission Levels

LevelCodeDescription
Department Admins0Only department administrators
Department + Group Admins1Department admins and group/station admins
Admins + Select Roles2Admins plus users with specific personnel roles
Everyone3All department members

Setting Permissions

SetPermission: Sets the permission level for a type.

SetPermissionData: Sets additional data (e.g., role IDs) for a permission type while keeping the current action level.

Cache Refresh

When location/unit/personnel visibility permissions change, a SecurityRefreshEvent is dispatched to invalidate caches across the system.

Audit Logs

Viewing Audit Logs

The audit log system records all significant operations across the application:

  • Timestamp
  • Audit type (e.g., DepartmentSettingsChanged, CallAdded, PersonnelRemoved)
  • Descriptive message
  • Before/after JSON snapshots
  • Acting user
  • IP address and user agent

Audit Log Endpoints

EndpointPurpose
GetAuditLogsListAll audit logs as JSON with formatted timestamps and type strings
ViewAuditSingle audit log entry detail (validates department ownership)

Interactions with Other Modules

Security permissions affect behavior across the entire application:

ModuleAffected Permissions
PersonnelAddPersonnel, RemovePersonnel, ViewPersonalInfo
DispatchCreateCall, DeleteCall, CloseCall, AddCallData
MappingViewPersonnelLocation, ViewUnitLocation
UnitsViewGroupUnits
GroupsViewGroupUsers
InventoryAdjustInventory
DocumentsCreateDocument
CalendarCreateCalendarEntry
NotesCreateNote
LogsCreateLog
ShiftsCreateShift
MessagesCreateMessage
TrainingsCreateTraining
ContactsViewContacts, EditContacts, DeleteContacts