Share user permissions code between server and client.