staff users can access all projects
This commit is contained in:
parent
f0087a8c06
commit
d0f1908a6a
1 changed files with 15 additions and 12 deletions
|
@ -29,6 +29,9 @@ class ProjectMiddleware:
|
|||
if request.user.is_authenticated():
|
||||
user = User.objects.get(username=request.user)
|
||||
|
||||
if user and user.is_staff:
|
||||
projects = Project.objects.all()
|
||||
else:
|
||||
query = Q(public=True)
|
||||
if user:
|
||||
# access granted through a team
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue