Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Video AG Infrastruktur
website
Commits
d04b45a2
Commit
d04b45a2
authored
8 years ago
by
Julian Rother
Browse files
Options
Downloads
Patches
Plain Diff
Allow all moderators full video access
parent
5502aae6
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server.py
+5
-4
5 additions, 4 deletions
server.py
with
5 additions
and
4 deletions
server.py
+
5
−
4
View file @
d04b45a2
...
...
@@ -116,6 +116,8 @@ def evalperm(perms):
@app.template_filter
()
def
checkperm
(
perms
,
username
=
None
,
password
=
None
):
if
ismod
():
return
True
perms
=
evalperm
(
perms
)
for
perm
in
perms
:
if
perm
[
'
type
'
]
==
'
public
'
:
...
...
@@ -501,7 +503,7 @@ def auth(): # For use with nginx auth_request
return
'
Internal Server Error
'
,
500
url
=
request
.
headers
[
'
X-Original-Uri
'
].
lstrip
(
config
[
'
VIDEOPREFIX
'
])
ip
=
request
.
headers
.
get
(
'
X-Real-IP
'
,
''
)
if
url
.
endswith
(
'
jpg
'
):
if
url
.
endswith
(
'
jpg
'
)
or
ismod
()
:
return
"
OK
"
,
200
perms
=
query
(
'''
SELECT videos.path, videos.id AS vid, perm.*
FROM videos
...
...
@@ -509,10 +511,9 @@ def auth(): # For use with nginx auth_request
JOIN courses ON (lectures.course_id = courses.id)
LEFT JOIN perm ON (videos.id = perm.video_id OR lectures.id = perm.lecture_id OR courses.id = perm.course_id)
WHERE videos.path = ?
AND
(? OR
(courses.visible AND lectures.visible AND videos.visible)
)
AND (courses.visible AND lectures.visible AND videos.visible)
ORDER BY perm.video_id DESC, perm.lecture_id DESC, perm.course_id DESC
'''
,
url
,
ismod
())
url
)
if
not
perms
:
return
"
Not allowed
"
,
403
auth
=
request
.
authorization
...
...
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