The main idea here is to remove from the `Context` class all the aspects related to resource identification and description, and to keep only what is needed for doing the rendering.
In effect, the main focus of that `Context` class is now to be exclusively a "rendering context", which aims at providing all the necessary information for the rendering layer, ultimately allowing us to get rid on the dependency on the `req` in this part of the code.
The resource identification part is now the responsibility of a new `Resource` class, which is quite simple (no subclassing) and mainly offers a convenient access to the `.realm`, `.id` and `.version` information.
A `Resource` also provides a convenient way to call the `IResourceManager` methods of the component in charge of the realm of that resource. Those `IResourceManager` methods are:
- `get_resource_url` for retrieving the canonical URL associated to the resource
- `get_resource_description` for retrieving a representation of the resource in a generic way, according to some format
Finally, a `Resource` offers some facilities for creating other related resources, mostly useful for creating a resource for another version than the current one or for creating `child` resources.
The fine grained permissions are now operating exclusively on the `Resource` objects, not on `Context` objects anymore.
The current changeset is pretty large, but most of the changes are happening in a few places, like the trac/context.py file which is nearly entirely rewritten and in 3 modules: the attachment, the wiki/web_ui.py and the ticket/web_ui.py.
The state of this branch is quite stable, all the unit tests are passing and the features are mostly all working, with the exception of Ticket diff views.
So I think this is a good basis for further experiments.