I need to add something to this, as the header indicates that we cannot access the sleep mode properties.
There are two releases of hasPermission, a loaded object, and a serialized object. Here is the code from the test case:
@PreAuthorize("isAuthenticated() and hasPermission(#organization, 'edit')") public long protectedMethod(Organization organization) { return organization.getId(); }
And for the latter, here we see that we can enter access to the id id of the organization (which is a sleeping entity):
@PreAuthorize("isAuthenticated() and hasPermission(#organization.getId(), 'organization', 'edit')") public long protectedMethodSerializableEdtion(Organization organization) { return organization.getId(); }
source share