Skip to content

Revisit AuthorizationManager generics and nullability #17537

Open
@rwinch

Description

@rwinch

Why can't SessionConcurrencyDslTests have a null value below?

val isAdmin: AuthorizationManager<Any> = AuthorityAuthorizationManager.hasRole("ADMIN")
            http {
                sessionManagement {
                    sessionConcurrency {
                        maximumSessions {
                            authentication -> if (isAdmin.authorize({ authentication }, "")!!.isGranted) -1 else 1 // why can't "" be changed to null here?
                        }
                        maxSessionsPreventsLogin = true
                    }
                }
                formLogin { }
            }
            return http.build()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions