Add support for proxy model permission inheritance
Proxy models now get the permission inheritance from their base model. Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -80,6 +80,10 @@ class ModelPermission(object):
|
||||
|
||||
@classmethod
|
||||
def get_inheritance(cls, model):
|
||||
# Proxy models get the inheritance from their base model
|
||||
if model._meta.proxy:
|
||||
model = model._meta.proxy_for_model
|
||||
|
||||
return cls._inheritances[model]
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user