Make permissions settable from test

Added code to enable a test to set permissions in app.lastuser_auth_data.