Let users with submit_as permission list non-public review requests.
Review Request #7196 — Created April 11, 2015 and submitted
Information | |
---|---|
halvorlu | |
Review Board | |
master | |
7195 | |
0babcc6... | |
Reviewers | |
reviewboard | |
Until now,
rbt post
with the submit-as option could not update unpublished review requests. I've proposed that users with thecan_submit_as_another_user
permission are allowed to list unpublished review requests, so thatrbt post
knows about these and can update them. Previously only superusers could list unpublished review requests.
- Expanded unit test to test that
can_submit_as_another_user
gives user access to unpublished review requests - Tested with
rbt post -u --submit-as=submitter
to update unpublished review request (see also #7195)
Description | From | Last Updated |
---|---|---|
This will need to take the local_site parameter as well. |
|
|
There is a possibility that the url will have show-all-unpublished=0, so this should probably use request.GET.get('show-all-unpublished', False) instead. |
|
|
We actually should probably coerce this to an integer. If show-all-unpublished=0 is given in the URL, then request_unpublished will be … |
|
|
Can we assign request.GET.get('show-all-unpublished, '0') to a variable (e.g. show_all_unpublished) before doing the in operation so that we don't need … |
|
|
Can you pull this out into a separate test method? |
|
-
<p>Seems reasonable. Thanks for the patch! I just have one comment.</p>
-
reviewboard/webapi/resources/review_request.py (Diff revision 1) This will need to take the local_site parameter as well.
Change Summary:
Added local_site as argument to has_perm.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+28 -15) |

-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/webapi/tests/test_review_request.py Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/webapi/tests/test_review_request.py
-
-
reviewboard/webapi/resources/review_request.py (Diff revision 2) There is a possibility that the url will have
show-all-unpublished=0
, so this should probably userequest.GET.get('show-all-unpublished', False)
instead.
Change Summary:
Don't show unpublished reivew requests if
show-all-unpublished
is (e.g.) 0.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+30 -15) |

-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/webapi/tests/test_review_request.py Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/webapi/tests/test_review_request.py
-
-
reviewboard/webapi/tests/test_review_request.py (Diff revision 3) Can you pull this out into a separate test method?
-
-
reviewboard/webapi/resources/review_request.py (Diff revision 3) We actually should probably coerce this to an integer. If
show-all-unpublished=0
is given in the URL, thenrequest_unpublished
will be 0, which is truthy in Python.If we cannot coerce to an int, we can probably safely assume it is false.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 4 (+44 -16) |

-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/webapi/tests/test_review_request.py Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/webapi/tests/test_review_request.py
-
-
reviewboard/webapi/resources/review_request.py (Diff revisions 3 - 4) Can we assign
request.GET.get('show-all-unpublished, '0')
to a variable (e.g.show_all_unpublished
) before doing thein
operation so that we don't need the backslash?
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 5 (+44 -16) |