I believe that what you have written above should work on the server.
On the client there is a gotcha: