Skip to content

Instantly share code, notes, and snippets.

@jasondlee
Created September 11, 2023 20:32
Show Gist options
  • Save jasondlee/c3e0e1deeff54d7c12a3139adbf80bf6 to your computer and use it in GitHub Desktop.
Save jasondlee/c3e0e1deeff54d7c12a3139adbf80bf6 to your computer and use it in GitHub Desktop.
@Alternative
@Priority(Interceptor.Priority.LIBRARY_BEFORE)
@ApplicationScoped
class DisabledAuthController : AuthorizationController() {
@ConfigProperty(name = "myapp.disable.authorization")
var disableAuthorization = false
override fun isAuthorizationEnabled(): Boolean {
return !disableAuthorization
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment