jamesfredley commented on issue #15899: URL: https://github.com/apache/grails-core/issues/15899#issuecomment-5972053714
`springSecurityService.getCurrentUserId()` is a public method and it is still there on `8.0.x`, `8.1.x`, and `9.0.x`. When the principal is a `GrailsUser`, it returns `principal.id` and does not load the domain instance. It returns null for any other principal. The guide's recommendation for the case where only the id is needed is `loadCurrentUser()`, which uses that id to return a GORM proxy: https://docs.grails.org/latest/guide/security.html#core-springSecurityService Use `getCurrentUser()` when you need the domain instance. Use `loadCurrentUser()` when you only need the id as a foreign key. `getCurrentUserId()` remains available for the raw id. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
