Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nk20
Manage
Activity
Members
Labels
Plan
Issues
31
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BDE
nk20
Merge requests
!10
Système de droits
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Système de droits
rights
into
master
Overview
0
Commits
40
Pipelines
1
Changes
42
Merged
Benjamin Graillot
requested to merge
rights
into
master
5 years ago
Overview
0
Commits
40
Pipelines
1
Changes
8
Expand
👍
0
👎
0
Merge request reports
Viewing commit
24ea4c0a
Prev
Next
Show latest version
8 files
+
57
−
21
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
8
Search (e.g. *.vue) (Ctrl+P)
24ea4c0a
Comment code
· 24ea4c0a
ynerant
authored
5 years ago
apps/permission/templatetags/perms.py
+
6
−
0
Options
@@ -12,6 +12,9 @@ from permission.backends import PermissionBackend
@stringfilter
def
not_empty_model_list
(
model_name
):
"""
Return True if and only if the current user has right to see any object of the given model.
"""
user
=
get_current_authenticated_user
()
session
=
get_current_session
()
if
user
is
None
:
@@ -29,6 +32,9 @@ def not_empty_model_list(model_name):
@stringfilter
def
not_empty_model_change_list
(
model_name
):
"""
Return True if and only if the current user has right to change any object of the given model.
"""
user
=
get_current_authenticated_user
()
session
=
get_current_session
()
if
user
is
None
:
Loading