Implement ApplicationContext
References: #395 (closed), permission design blueprint.
This ticket tracks adding an ApplicationContext
for debusine operations.
An application context is an object, from an ApplicationContext
class hierarchy, that encodes the scope of an operation.
The idea is to create an object at the Model layer that contains references to model objects needed for permission checking, so that it can be also used for permission checking in model methods.
Some design is needed to see what is the best way to introduce this: it can be stored in the request and passed explicitly to model methods, or in a contextvar-like global object to avoid big refactorings. See this thread for a discussion.
Likely next steps:
-
Draft an initial class hierarchy -
Create infrastructure to instantiate an ApplicationContext and make it available to view or model methods (!1122 (merged), !1136 (merged))
Edited by Enrico Zini