Remove Compliance SDK category from sidebar navigation as it is now handled exclusively in the Compliance Admin. Add new SDK modules (DSB Portal, Industry Templates, Multi-Tenant, Reporting, SSO) and GCI engine components. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
119 lines
3.7 KiB
Go
119 lines
3.7 KiB
Go
package gci
|
|
|
|
// NIS2Role defines a NIS2 role classification
|
|
type NIS2Role struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
MandatoryModules []string `json:"mandatory_modules"`
|
|
Priority int `json:"priority"` // 1=highest
|
|
}
|
|
|
|
// NIS2RoleAssignment represents a user's NIS2 role
|
|
type NIS2RoleAssignment struct {
|
|
TenantID string `json:"tenant_id"`
|
|
UserID string `json:"user_id"`
|
|
UserName string `json:"user_name"`
|
|
RoleID string `json:"role_id"`
|
|
RoleName string `json:"role_name"`
|
|
AssignedAt string `json:"assigned_at"`
|
|
}
|
|
|
|
// NIS2 role definitions
|
|
var NIS2Roles = map[string]NIS2Role{
|
|
"N1": {
|
|
ID: "N1",
|
|
Name: "Geschaeftsleitung",
|
|
Description: "Leitungsorgane mit persoenlicher Haftung gemaess NIS2 Art. 20",
|
|
Priority: 1,
|
|
MandatoryModules: []string{
|
|
"nis2-management",
|
|
"nis2-risikomanagement",
|
|
"dsgvo-grundlagen",
|
|
"iso-isms",
|
|
},
|
|
},
|
|
"N2": {
|
|
ID: "N2",
|
|
Name: "IT-Sicherheit / CISO",
|
|
Description: "Verantwortliche fuer IT-Sicherheit und Cybersecurity",
|
|
Priority: 2,
|
|
MandatoryModules: []string{
|
|
"nis2-risikomanagement",
|
|
"nis2-incident-response",
|
|
"nis2-supply-chain",
|
|
"iso-zugangssteuerung",
|
|
"iso-kryptografie",
|
|
},
|
|
},
|
|
"N3": {
|
|
ID: "N3",
|
|
Name: "Kritische Funktionen",
|
|
Description: "Mitarbeiter in kritischen Geschaeftsprozessen",
|
|
Priority: 3,
|
|
MandatoryModules: []string{
|
|
"nis2-risikomanagement",
|
|
"nis2-incident-response",
|
|
"dsgvo-tom",
|
|
"iso-zugangssteuerung",
|
|
},
|
|
},
|
|
"N4": {
|
|
ID: "N4",
|
|
Name: "Allgemeine Mitarbeiter",
|
|
Description: "Alle Mitarbeiter mit IT-Zugang",
|
|
Priority: 4,
|
|
MandatoryModules: []string{
|
|
"nis2-risikomanagement",
|
|
"dsgvo-grundlagen",
|
|
"iso-isms",
|
|
},
|
|
},
|
|
"N5": {
|
|
ID: "N5",
|
|
Name: "Incident Response Team",
|
|
Description: "Mitglieder des IRT/CSIRT gemaess NIS2 Art. 21",
|
|
Priority: 2,
|
|
MandatoryModules: []string{
|
|
"nis2-incident-response",
|
|
"nis2-risikomanagement",
|
|
"nis2-supply-chain",
|
|
"iso-zugangssteuerung",
|
|
"iso-kryptografie",
|
|
"iso-isms",
|
|
},
|
|
},
|
|
}
|
|
|
|
// GetNIS2Role returns a NIS2 role by ID
|
|
func GetNIS2Role(roleID string) (NIS2Role, bool) {
|
|
r, ok := NIS2Roles[roleID]
|
|
return r, ok
|
|
}
|
|
|
|
// ListNIS2Roles returns all NIS2 roles sorted by priority
|
|
func ListNIS2Roles() []NIS2Role {
|
|
roles := []NIS2Role{}
|
|
// Return in priority order
|
|
order := []string{"N1", "N2", "N5", "N3", "N4"}
|
|
for _, id := range order {
|
|
if r, ok := NIS2Roles[id]; ok {
|
|
roles = append(roles, r)
|
|
}
|
|
}
|
|
return roles
|
|
}
|
|
|
|
// MockNIS2RoleAssignments returns mock role assignments
|
|
func MockNIS2RoleAssignments(tenantID string) []NIS2RoleAssignment {
|
|
return []NIS2RoleAssignment{
|
|
{TenantID: tenantID, UserID: "user-001", UserName: "Dr. Schmidt", RoleID: "N1", RoleName: "Geschaeftsleitung", AssignedAt: "2025-06-01"},
|
|
{TenantID: tenantID, UserID: "user-002", UserName: "M. Weber", RoleID: "N2", RoleName: "IT-Sicherheit / CISO", AssignedAt: "2025-06-01"},
|
|
{TenantID: tenantID, UserID: "user-003", UserName: "S. Mueller", RoleID: "N5", RoleName: "Incident Response Team", AssignedAt: "2025-07-15"},
|
|
{TenantID: tenantID, UserID: "user-004", UserName: "K. Fischer", RoleID: "N3", RoleName: "Kritische Funktionen", AssignedAt: "2025-08-01"},
|
|
{TenantID: tenantID, UserID: "user-005", UserName: "L. Braun", RoleID: "N3", RoleName: "Kritische Funktionen", AssignedAt: "2025-08-01"},
|
|
{TenantID: tenantID, UserID: "user-006", UserName: "A. Schwarz", RoleID: "N4", RoleName: "Allgemeine Mitarbeiter", AssignedAt: "2025-09-01"},
|
|
{TenantID: tenantID, UserID: "user-007", UserName: "T. Wagner", RoleID: "N4", RoleName: "Allgemeine Mitarbeiter", AssignedAt: "2025-09-01"},
|
|
}
|
|
}
|