Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
6677c9f2
Commit
6677c9f2
authored
Oct 13, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for user permissions on report download
Issue #798 Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
f92208f6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
0 deletions
+11
-0
weblate/html/translation.html
weblate/html/translation.html
+1
-0
weblate/trans/tests/test_reports.py
weblate/trans/tests/test_reports.py
+2
-0
weblate/trans/views/reports.py
weblate/trans/views/reports.py
+8
-0
No files found.
weblate/html/translation.html
View file @
6677c9f2
...
...
@@ -16,6 +16,7 @@
{% block content %}
{% can_see_repository_status user object.subproject.project as user_can_see_repository_status %}
{% can_commit_translation user object.subproject.project as user_can_commit_translation %}
{% can_view_reports user object.subproject.project as user_can_view_reports %}
{% include "show-lock.html" %}
...
...
weblate/trans/tests/test_reports.py
View file @
6677c9f2
...
...
@@ -30,6 +30,8 @@ import json
class
ReportsTest
(
ViewTestCase
):
def
setUp
(
self
):
super
(
ReportsTest
,
self
).
setUp
()
self
.
user
.
is_superuser
=
True
self
.
user
.
save
()
def
add_change
(
self
):
response
=
self
.
edit_unit
(
...
...
weblate/trans/views/reports.py
View file @
6677c9f2
...
...
@@ -21,9 +21,12 @@
from
weblate.trans.models.changes
import
Change
from
weblate.trans.forms
import
CreditsForm
from
weblate.trans.views.helper
import
get_subproject
from
weblate.trans.permissions
import
can_view_reports
from
django.http
import
HttpResponse
from
django.views.decorators.http
import
require_POST
from
django.shortcuts
import
redirect
from
django.contrib.auth.decorators
import
login_required
from
django.core.exceptions
import
PermissionDenied
import
json
...
...
@@ -45,10 +48,15 @@ def generate_credits(component, start_date):
return
result
@
login_required
@
require_POST
def
get_credits
(
request
,
project
,
subproject
):
"""View for credits"""
obj
=
get_subproject
(
request
,
project
,
subproject
)
if
not
can_view_reports
(
request
.
user
,
obj
.
project
):
raise
PermissionDenied
()
form
=
CreditsForm
(
request
.
POST
)
if
not
form
.
is_valid
():
...
...
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