diff --git a/sapl/materia/admin.py b/sapl/materia/admin.py index 5c02ebd40..04b98c5a9 100644 --- a/sapl/materia/admin.py +++ b/sapl/materia/admin.py @@ -1,3 +1,24 @@ +from django.contrib import admin +from sapl.materia.models import Proposicao +from sapl.settings import DEBUG from sapl.utils import register_all_models_in_admin register_all_models_in_admin(__name__) + +DEBUG = False + +if not DEBUG: + + admin.site.unregister(Proposicao) + + class ProposicaoAdmin(admin.ModelAdmin): + def has_add_permission(self, request, obj=None): + return False + + def has_change_permission(self, request, obj=None): + return False + + def has_delete_permission(self, request, obj=None): + return False + + admin.site.register(Proposicao, ProposicaoAdmin)