The current system for maintaining the current user during verb execution is showing its age (and a certain lack of creativity on my part). It works fine, but it uses global variables to maintain state (yuck), and it also is dependent on running within an asynchronous environment, where verb code always runs within one iteration of the reactor.
This makes supporting new protocols difficult, since things like object editing and other more interactive features require the protocol to maintain the user state, which is inelegant. Furthermore, if glyph ever sees the way I've implemented PB support, I might have to join the FBI relocation program.
The solution I'm going to try is very simple. Every operation on an entity object will require a second parameter (after 'self') called 'ctx', which will be the user context to execute in. This is the user object that will be tested for permissions, etc.
Verb code shouldn't change, however, since all entities in verb code will have to pass through a filter that will convert them to a wrapper object that passes all calls through to the underlying entity while adding the 'ctx' argument.
The hardest part will be keeping a clean separation between protected code and verb code, and staying sane about where to convert objects back and forth.
