Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
14
Issues
14
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
La Quadrature du Net
rpteam
rp
Commits
b44edf71
Verified
Commit
b44edf71
authored
Jan 09, 2018
by
Thibaut Broggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add permission "can_delete_users"
Only jedi have that permission
parent
3507e647
Pipeline
#1808
passed with stages
in 2 minutes and 59 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
2 deletions
+22
-2
apps/core/management/commands/init_groups.py
apps/core/management/commands/init_groups.py
+1
-1
apps/userprofile/migrations/0003_auto_20180109_1642.py
apps/userprofile/migrations/0003_auto_20180109_1642.py
+19
-0
apps/userprofile/models.py
apps/userprofile/models.py
+1
-0
apps/userprofile/views/users.py
apps/userprofile/views/users.py
+1
-1
No files found.
apps/core/management/commands/init_groups.py
View file @
b44edf71
...
...
@@ -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"
]
}
...
...
apps/userprofile/migrations/0003_auto_20180109_1642.py
0 → 100644
View file @
b44edf71
# -*- 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'
},
),
]
apps/userprofile/models.py
View file @
b44edf71
...
...
@@ -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
):
...
...
apps/userprofile/views/users.py
View file @
b44edf71
...
...
@@ -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'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment