I\'d like to use a permissions based system to restrict certain actions within my Django application. These actions need not be related to a particular model (e.g. access to sec
Django's Permission
model requires a ContentType instance.
I think one way around it is creating a dummy ContentType
that isn't related to any model (the app_label
and model
fields can be set to any string value).
If you want it all clean and nice, you can create a Permission
proxy model that handles all the ugly details of the dummy ContentType
and creates "modelless" permission instances. You can also add a custom manager that filters out all Permission
instances related to real models.