Zum Inhalt springen

Assert For Auth Control (ARCH9133)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Key swift.security.assert-for-auth-control · Severity warning · Category security · CWE CWE-617

Flags assert() / assertionFailure used for authorization checks - assertions are compiled out in release builds.

assert(user.isAdmin)
guard user.isAdmin else { throw Abort(.forbidden) }

Enforce with a guard that always runs.