Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GraceDB Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
IGWN Computing and Software
GraceDB
GraceDB Server
Commits
344c0d54
Commit
344c0d54
authored
9 years ago
by
Branson Craig Stephens
Browse files
Options
Downloads
Patches
Plain Diff
Fixed security problems with Latest view
parent
6af41901
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gracedb/permission_utils.py
+4
-0
4 additions, 0 deletions
gracedb/permission_utils.py
gracedb/views.py
+2
-0
2 additions, 0 deletions
gracedb/views.py
with
6 additions
and
0 deletions
gracedb/permission_utils.py
+
4
−
0
View file @
344c0d54
...
...
@@ -3,6 +3,7 @@ from guardian.shortcuts import assign_perm
from
django.contrib.auth.models
import
Group
from
django.utils.functional
import
wraps
from
django.http
import
HttpResponseForbidden
from
gracedb.models
import
Event
#-------------------------------------------------------------------------------
# A convenient wrapper for permission checks.
...
...
@@ -18,6 +19,9 @@ def user_has_perm(user, shortname, obj):
# when there are many objects.
#-------------------------------------------------------------------------------
def
filter_events_for_user
(
events
,
user
,
shortname
):
# If user is None, return empty queryset
if
not
user
:
return
Event
.
objects
.
none
()
auth_filter
=
Q
()
for
group
in
user
.
groups
.
all
():
perm_string
=
'
%s_can_%s
'
%
(
group
.
name
,
shortname
)
...
...
This diff is collapsed.
Click to expand it.
gracedb/views.py
+
2
−
0
View file @
344c0d54
...
...
@@ -556,6 +556,8 @@ def oldsearch(request):
context_instance
=
RequestContext
(
request
))
def
latest
(
request
):
if
not
request
.
user
or
not
request
.
user
.
is_authenticated
():
return
HttpResponseForbidden
(
"
Forbidden
"
)
context
=
{}
if
request
.
method
==
"
GET
"
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment