Set the context's user when fetching user preferences

review1711002
Backed out changeset a0dfdb90681e
Set the context's user when fetching user preferences

The call to _get_preferences makes some processing based on the user of the
context.

In order for those computations to return the right value the context must be
set when instanciating the user.

issue3068
review1711002