Zum Inhalt springen

Assert For Auth Control (ARCH8133)

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

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

Flags assert(...) used for authorization checks - assertions are off unless the JVM runs with -ea.

assert(user.isAdmin)
if (!user.isAdmin) throw AccessDeniedException()

Enforce with an if / require that always runs.