Commit b44edf71 authored by Thibaut Broggi's avatar Thibaut Broggi

Add permission "can_delete_users"

    Only jedi have that permission
parent 3507e647
Pipeline #1808 passed with stages
in 2 minutes and 59 seconds
......@@ -5,7 +5,7 @@ groups = ["droid", "jedi", "padawan"]
permissions = {
"droid": [],
"jedi": [
"can_change_status", "can_change_priority", "can_vote", "can_edit", "can_edit_users"
"can_change_status", "can_change_priority", "can_vote", "can_edit", "can_edit_users", "can_delete_users"
],
"padawan": ["can_vote", "add_article"]
}
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2018-01-09 16:42
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('userprofile', '0002_auto_20171129_1130'),
]
operations = [
migrations.AlterModelOptions(
name='profile',
options={'permissions': (('can_edit_users', 'Can edit users'), ('can_delete_users', 'Can delete users')), 'verbose_name': 'User'},
),
]
......@@ -41,6 +41,7 @@ class Profile(models.Model):
app_label = "userprofile"
permissions = (
("can_edit_users", "Can edit users",),
("can_delete_users", "Can delete users",),
)
def __str__(self):
......
......@@ -33,7 +33,7 @@ class UserEditView(LoginRequiredMixin, PermissionRequiredMixin, UpdateView):
class UserDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteView):
model = User
permission_required = 'userprofile.can_edit_users'
permission_required = 'userprofile.can_delete_users'
template_name = 'user/user_delete_confirm.html'
context_object_name = 'user_delete'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment