diff --git a/aleksis/apps/tezor/rules.py b/aleksis/apps/tezor/rules.py index 90f0a02590fbfd180a6a725a2744834d16e50d11..3283b77567547f88472b26260846f1224ef734e3 100644 --- a/aleksis/apps/tezor/rules.py +++ b/aleksis/apps/tezor/rules.py @@ -24,10 +24,10 @@ edit_client_predicate = has_person & ( rules.add_perm("tezor.edit_client_rule", edit_clients_predicate) # Create clients -create_clients_predicate = has_person & ( +create_client_predicate = has_person & ( has_global_perm("tezor.create_client") | has_any_object("tezor.create_client", Client) ) -rules.add_perm("tezor.create_clients_rule", create_clients_predicate) +rules.add_perm("tezor.create_client_rule", create_client_predicate) # Delete clients delete_client_predicate = has_person & ( diff --git a/aleksis/apps/tezor/views.py b/aleksis/apps/tezor/views.py index 93efd5e9ee14254e138d74e6b2556fd8dd6fcc01..04a87cd641643b58cba1e1ff6a5015ec7c89846a 100644 --- a/aleksis/apps/tezor/views.py +++ b/aleksis/apps/tezor/views.py @@ -47,7 +47,7 @@ class ClientCreateView(PermissionRequiredMixin, AdvancedCreateView): model = Client form_class = EditClientForm - permission_required = "tezor.create_clients_rule" + permission_required = "tezor.create_client_rule" template_name = "tezor/client/create.html" success_url = reverse_lazy("clients") success_message = _("The client has been created.")