Add functionality for private review requests
Review Request #7727 — Created Oct. 23, 2015 and discarded
Project Description
Today, review requests can be made private if they're filed against a private repository or invite-only review group. However, there's no way to make one private if you just want to assign it to specific people.This project would allow a review request to be marked as private. Private review requests will only be visible to those who are on the reviewer list.
Only invite-only groups or individual users will be allowed as reviewers.
It should be possible to make a public review request private, but only if the reviewers list meets the above criteria, and no other reviews have been made. It should be possible to make a review request public at any point.
The API also needs to be updated to include a field representing whether the review request is private.
Updates
Pre 11/13/15
Update accessibility for private review requestsFix issues raised in review request
Create a new field for private instead of using extra_data
Update _query for to filter private requests
Limit the permission to set a review request private to just the owner and super user
Fix error with setting private to F instead of T
11/13/15
Move new private field to BaseReviewRequestDetails model since it is used in both ReviewRequest and ReviewRequestDraftUpdate database evolutions accordingly
11/16/15
Experiment with different ways to set the private field to true11/18/15
Add PrivateField to reviews/buildin_fields.pyClean up formatting caught by ReviewBot
Fix some typos and docstrings in review request model
11/20/15
Set Private button finally works!Clean up some formatting
11/25/15
Create a new button for making a review request no longer private and write the handler for itMake the existing button a little prettier
Remove debugging code
Fix issues raised in the last review request
11/27/15
Add very basic permissions for who can change the privacy status of a review request. This is done by hiding the set private button if the user is not a superuser or the submitter of the review request.11/30/15
Add a basic check to see if the privacy status of the review request can be changed. The status cannot be changed if there are non-invite-only groups in the list of target review groups or if the user does not have the required editting permissions. If it cannot, the publish button gets greyed out. A warning is also logged to the console.Tested the new check mentioned above.
12/1/15
Add a toggle for the privacy lock icon so there is only one button instead of two. Now unlock icon will be shown when the review request can be set unprivate, meaning that the review request is currently private. If a review request is not private, a lock icon will be shown instead, indicating that the review request can be set to private. These icons will only be shown if the user already has the necessary permissions.Test the toggling for the new single button.
12/2/15
Allow review requests to be accessed by submitters and target people in the "All Review Requests" page. These were previously hidden due to the strictness of the private query.
Test set private
To test the "set private" button, I selected an existing review request and clicked the button to set it to private. I then opened an icognito window to check that the private review request did not show up under "All Review Requests".Next I set a particular review request to private and then logged in to the user account that submitted the review request. Using that account, I was still able to access the review request.
I also tried to directly open a review request that was set to private by going directly to the URL in the incognito window and was greeted by a Permission Denied error. This validates the functionality.
Test unset private
To test the "unset private" button, I first set a review request to private. Then, verifying that it was correctly set to private, clicked the "unset private" button. I opened an incognito window to make sure the review request had once again appeared under "All Review Requests". I also logged into a user account to make sure a logged in user could also access the review request.Test basic permissions for changing privacy status
I tested the basic permissions with three scenarios. First I logged in on a superuser account and was able to set any review request to private, regardless of the submitter. The change privacy button was not hidden in this case.Next I logged in to a regular account and was able to change the privacy status of review requests that were submitted by that account. The change privacy button was hidden for review requests for which that account was not the submitter.
Finally I logged out and was unable to change the privacy status of any review requests. The privacy buttons were always hidden in this case.
Test set private when the review list contains non-invite-only review groups
I tested this by creating a review group that was not invite-only and adding the group to the reviewer list for a review request. I then tried to set the review request to private by clicking the "set private" button. When I did this, the "publish request" button was greyed out and an error was logged to the console.Using an alternate review request, I added a review group that was invite-only and was able to properly set the review request to private. I then signed in on an account where a user was a member of that invite-only review group and was able to view the review request on that account. This indicates that the functionality is working as intended.
Test change privacy icon toggle
First I logged in on the superuser account to be able to change the privacy status of any review request. When selecting a particular review request, the single lock icon appeared, meaning that I could set the review request to private. I clicked the button and published the review request. After doing this, the lock icon turned into an unlock icon meaning that the review request was private and could be set to no longer private.
Description | From | Last Updated |
---|---|---|
You can just use self.is_mutable_by(user) here. |
david | |
You can just use self.is_mutable_by(user) here. |
david | |
This method doesn't add anything over users just accessing review_request.private. I'd get rid of it. |
david | |
Single quotes. |
brennie | |
Only one space after a period. |
brennie | |
"superuser" |
brennie | |
I feel like this should raise an exception that can be caught so it can be returned to the front … |
brennie | |
Again, I feel this should throw an exception. |
brennie | |
This will need to be tested. |
brennie | |
Update the docstring to indicate the new changes. |
brennie | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
The docstring should make it clear that this does not call save(). |
brennie | |
Missing a period. |
AD adriano | |
As far as I can tell, Django QuerySets are iterable, and Python's for loops are smart enough to only execute … |
AD adriano | |
There seems to be a typo: exlude -> exclude. You also might want to consider using the exists() method instead, … |
AD adriano | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
Col: 13 E265 block comment should start with '# ' |
reviewbot | |
Col: 58 E262 inline comment should start with '# ' |
reviewbot | |
Col: 57 E261 at least two spaces before inline comment |
reviewbot | |
Col: 22 E203 whitespace before ':' |
reviewbot | |
Col: 80 E501 line too long (84 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (105 > 79 characters) |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 80 E501 line too long (84 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (105 > 79 characters) |
reviewbot | |
Can we rename this to isPrivate so we don't have to quote it? You'll need to add an entry to … |
brennie | |
Same here. |
brennie | |
JS objects can't end in a comma. |
brennie | |
Col: 80 E501 line too long (84 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (105 > 79 characters) |
reviewbot | |
Needs: def should_render(self, value): return False |
brennie | |
Col: 80 E501 line too long (84 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (105 > 79 characters) |
reviewbot | |
How about "This field is is rendered through a different mechanism and so the default rendering mechanism doesn't apply." |
brennie | |
Needs Args and Returns |
brennie | |
Col: 80 E501 line too long (84 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (105 > 79 characters) |
reviewbot | |
Returns: is documented here but I think Args: may need to be documented as well. |
AH ahache | |
Same as above? |
AH ahache | |
Did you update RBSearchView.get_results? |
brennie | |
Can we call this can_set_private and have it return whether or not the user can change the privacy? Also, can … |
brennie | |
Remove this. |
brennie | |
See comment about can_set_private. |
brennie | |
Combine these rules? |
brennie | |
Trailing whitespace. |
brennie | |
Trailing whitespace. |
brennie | |
We should only show one of these at a time. The JS can toggle the class between fa-unlock and fa-lock. |
brennie | |
I prefer fa-unlock-alt for this icon. |
brennie | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 17 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 17 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 17 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 21 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 21 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 21 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 17 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 17 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 17 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 21 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 21 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 21 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 57 W291 trailing whitespace |
reviewbot | |
Col: 52 W291 trailing whitespace |
reviewbot | |
Col: 73 W291 trailing whitespace |
reviewbot |
-
This review request seems to supercede your old one at /r/7705/ . If that's true, can you discard that one?
-
Tool: Pyflakes Processed Files: reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/models/review_request.py reviewboard/reviews/managers.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/models/review_request.py reviewboard/reviews/managers.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html
-
Tool: Pyflakes Processed Files: reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/models/review_request.py reviewboard/reviews/managers.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/models/review_request.py reviewboard/reviews/managers.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html
- Diff:
-
Revision 4 (+110 -3)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/webapi/resources/review_request.py reviewboard/reviews/models/review_request.py reviewboard/reviews/managers.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/webapi/resources/review_request.py reviewboard/reviews/models/review_request.py reviewboard/reviews/managers.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js
- Description:
-
~ Update accessibility for private review requests
~ Pre 11/13/15
+ Update accessibility for private review requests Fix issues raised in review request
Create a new field for private instead of using extra_data
Update _query for to filter private requests
Limit the permission to set a review request private to just the owner and super user
Fix error with setting private to F instead of T
+ + 11/13/15
+ Move new private field to BaseReviewRequestDetails model since it is used in both ReviewRequest and ReviewRequestDraft + + Update database evolutions accordingly
- Diff:
-
Revision 5 (+119 -3)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js
-
-
-
-
-
As far as I can tell, Django
QuerySets
are iterable, and Python's for loops are smart enough to only execute the database query once. So (unless you plan to reuse this list ofgroups
later) there is no need to cache the results as a list and we can replace this with:for group in self.target_groups.all():
-
There seems to be a typo:
exlude
->exclude
.You also might want to consider using the
exists()
method instead, as it might be slightly more efficient. Something like:if self.reviews.exclude(user=user).exists():
- Change Summary:
-
11/16/15
Experiment with different ways to set the private field to true - Description:
-
Pre 11/13/15
Update accessibility for private review requests Fix issues raised in review request
Create a new field for private instead of using extra_data
Update _query for to filter private requests
Limit the permission to set a review request private to just the owner and super user
Fix error with setting private to F instead of T
11/13/15
Move new private field to BaseReviewRequestDetails model since it is used in both ReviewRequest and ReviewRequestDraft Update database evolutions accordingly
+ + 11/16/15
+ Experiment with different ways to set the private field to true - Diff:
-
Revision 6 (+132 -3)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js
-
-
-
-
-
-
-
-
-
- Groups:
- Description:
-
Pre 11/13/15
Update accessibility for private review requests Fix issues raised in review request
Create a new field for private instead of using extra_data
Update _query for to filter private requests
Limit the permission to set a review request private to just the owner and super user
Fix error with setting private to F instead of T
11/13/15
Move new private field to BaseReviewRequestDetails model since it is used in both ReviewRequest and ReviewRequestDraft Update database evolutions accordingly
11/16/15
Experiment with different ways to set the private field to true + + 11/18/15
+ Clean up formatting caught by ReviewBot - Diff:
-
Revision 7 (+139 -3)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js
-
-
- Description:
-
Pre 11/13/15
Update accessibility for private review requests Fix issues raised in review request
Create a new field for private instead of using extra_data
Update _query for to filter private requests
Limit the permission to set a review request private to just the owner and super user
Fix error with setting private to F instead of T
11/13/15
Move new private field to BaseReviewRequestDetails model since it is used in both ReviewRequest and ReviewRequestDraft Update database evolutions accordingly
11/16/15
Experiment with different ways to set the private field to true 11/18/15
~ Clean up formatting caught by ReviewBot ~ Add PrivateField to reviews/buildin_fields.py + + Clean up formatting caught by ReviewBot
+ + Fix some typos and docstrings in review request model
- Diff:
-
Revision 8 (+139 -3)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js
-
-
- Description:
-
Pre 11/13/15
Update accessibility for private review requests Fix issues raised in review request
Create a new field for private instead of using extra_data
Update _query for to filter private requests
Limit the permission to set a review request private to just the owner and super user
Fix error with setting private to F instead of T
11/13/15
Move new private field to BaseReviewRequestDetails model since it is used in both ReviewRequest and ReviewRequestDraft Update database evolutions accordingly
11/16/15
Experiment with different ways to set the private field to true 11/18/15
Add PrivateField to reviews/buildin_fields.py Clean up formatting caught by ReviewBot
Fix some typos and docstrings in review request model
+ + 11/20/15
+ Clean up some formatting - Diff:
-
Revision 9 (+139 -3)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js
-
-
- Description:
-
Pre 11/13/15
Update accessibility for private review requests Fix issues raised in review request
Create a new field for private instead of using extra_data
Update _query for to filter private requests
Limit the permission to set a review request private to just the owner and super user
Fix error with setting private to F instead of T
11/13/15
Move new private field to BaseReviewRequestDetails model since it is used in both ReviewRequest and ReviewRequestDraft Update database evolutions accordingly
11/16/15
Experiment with different ways to set the private field to true 11/18/15
Add PrivateField to reviews/buildin_fields.py Clean up formatting caught by ReviewBot
Fix some typos and docstrings in review request model
11/20/15
~ Clean up some formatting ~ Set Private button finally works! + + Clean up some formatting
- Diff:
-
Revision 10 (+147 -3)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js
-
-
- Description:
-
Pre 11/13/15
Update accessibility for private review requests Fix issues raised in review request
Create a new field for private instead of using extra_data
Update _query for to filter private requests
Limit the permission to set a review request private to just the owner and super user
Fix error with setting private to F instead of T
11/13/15
Move new private field to BaseReviewRequestDetails model since it is used in both ReviewRequest and ReviewRequestDraft Update database evolutions accordingly
11/16/15
Experiment with different ways to set the private field to true 11/18/15
Add PrivateField to reviews/buildin_fields.py Clean up formatting caught by ReviewBot
Fix some typos and docstrings in review request model
11/20/15
Set Private button finally works! Clean up some formatting
+ + 11/25/15
+ Fix issues raised in the last review request - Testing Done:
-
+ To test the "set private" button, I selected an existing review request and clicked the button to set it to private. I then opened an icognito window to check that the private review request did not show up under "All Review Requests".
- Diff:
-
Revision 11 (+142 -3)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js
- Change Summary:
-
11/25/15
Create a new button for making a review request no longer private and write the handler for itMake the existing button a little prettier
Tested the functionality of the two buttons
Remove debugging code
Fix issues raised in the last review request
- Description:
-
Pre 11/13/15
Update accessibility for private review requests Fix issues raised in review request
Create a new field for private instead of using extra_data
Update _query for to filter private requests
Limit the permission to set a review request private to just the owner and super user
Fix error with setting private to F instead of T
11/13/15
Move new private field to BaseReviewRequestDetails model since it is used in both ReviewRequest and ReviewRequestDraft Update database evolutions accordingly
11/16/15
Experiment with different ways to set the private field to true 11/18/15
Add PrivateField to reviews/buildin_fields.py Clean up formatting caught by ReviewBot
Fix some typos and docstrings in review request model
11/20/15
Set Private button finally works! Clean up some formatting
11/25/15
~ Fix issues raised in the last review request ~ Create a new button for making a review request no longer private and write the handler for it + + Make the existing button a little prettier
+ + Remove debugging code
+ + Fix issues raised in the last review request
- Testing Done:
-
To test the "set private" button, I selected an existing review request and clicked the button to set it to private. I then opened an icognito window to check that the private review request did not show up under "All Review Requests".
+ + I also tried to directly open a review request that was set to private by going directly to the URL in the incognito window and was greeted by a Permission Denied error. This validates the functionality.
+ + To test the "unset private" button, I first set a review request to private. Then, verifying that it was correctly set to private, clicked the "unset private" button. I opened an incognito window to make sure the review request had once again appeared under "All Review Requests".
- Diff:
-
Revision 12 (+162 -5)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/css/ui/buttons.less reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/css/ui/buttons.less reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js
- Change Summary:
-
11/27/15
Add very basic permissions for who can change the privacy status of a review request. This is done by hiding the set private button if the user is not a superuser or the submitter of the review request. - Description:
-
Pre 11/13/15
Update accessibility for private review requests Fix issues raised in review request
Create a new field for private instead of using extra_data
Update _query for to filter private requests
Limit the permission to set a review request private to just the owner and super user
Fix error with setting private to F instead of T
11/13/15
Move new private field to BaseReviewRequestDetails model since it is used in both ReviewRequest and ReviewRequestDraft Update database evolutions accordingly
11/16/15
Experiment with different ways to set the private field to true 11/18/15
Add PrivateField to reviews/buildin_fields.py Clean up formatting caught by ReviewBot
Fix some typos and docstrings in review request model
11/20/15
Set Private button finally works! Clean up some formatting
11/25/15
Create a new button for making a review request no longer private and write the handler for it Make the existing button a little prettier
Remove debugging code
Fix issues raised in the last review request
+ + 11/27/15
+ Add very basic permissions for who can change the privacy status of a review request. This is done by hiding the set private button if the user is not a superuser or the submitter of the review request. - Testing Done:
-
~ To test the "set private" button, I selected an existing review request and clicked the button to set it to private. I then opened an icognito window to check that the private review request did not show up under "All Review Requests".
~ Test set private
+ To test the "set private" button, I selected an existing review request and clicked the button to set it to private. I then opened an icognito window to check that the private review request did not show up under "All Review Requests". I also tried to directly open a review request that was set to private by going directly to the URL in the incognito window and was greeted by a Permission Denied error. This validates the functionality.
~ To test the "unset private" button, I first set a review request to private. Then, verifying that it was correctly set to private, clicked the "unset private" button. I opened an incognito window to make sure the review request had once again appeared under "All Review Requests".
~ Test unset private
+ To test the "unset private" button, I first set a review request to private. Then, verifying that it was correctly set to private, clicked the "unset private" button. I opened an incognito window to make sure the review request had once again appeared under "All Review Requests". + + Test basic permissions for changing privacy status
+ I tested the basic permissions with three scenarios. First I logged in on a superuser account and was able to set any review request to private, regardless of the submitter. The privacy buttons were not hidden in this case. + + Next I logged in to a regular account and was able to change the privacy status of review requests that were submitted by that account. The privacy buttons were not hidden in this case for review requests for which that account was not the submitter.
+ + Finally I did not log in and was unable to change the privacy status of any review requests. The privacy buttons were always hidden in this case.
- Diff:
-
Revision 13 (+164 -5)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/css/ui/buttons.less reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/css/ui/buttons.less reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js
-
Screenshots?
For saving your, you'll want to look at overrideing
BaseReviewRequestField.save_field
to callcan_set_private
(see comments). e.g.def save_field(self, value): if value and not self.review_request_details.can_set_private(self.request.user): raise PublishError('...') elif not value and not self.review_request_details.can_unset_private(self.request.user): raise PublishError('...') self.review_request_details.private = value
-
-
Can we call this
can_set_private
and have it return whether or not the user can change the privacy?Also, can we move this to
BaseReviewRequestDetails
? -
-
-
-
-
-
We should only show one of these at a time. The JS can toggle the class between
fa-unlock
andfa-lock
. -
- Change Summary:
-
11/30/15
Add a basic check to see if the privacy status of the review request can be changed. The status cannot be changed if there are non-invite-only groups in the list of target review groups or if the user does not have the required editting permissions. If it cannot, the publish button gets greyed out. A warning is also logged to the console.Tested the new check mentioned above.
- Description:
-
~ Pre 11/13/15
~ Pre 11/13/15
Update accessibility for private review requests Fix issues raised in review request
Create a new field for private instead of using extra_data
Update _query for to filter private requests
Limit the permission to set a review request private to just the owner and super user
Fix error with setting private to F instead of T
~ 11/13/15
~ 11/13/15
Move new private field to BaseReviewRequestDetails model since it is used in both ReviewRequest and ReviewRequestDraft Update database evolutions accordingly
~ 11/16/15
~ 11/16/15
Experiment with different ways to set the private field to true ~ 11/18/15
~ 11/18/15
Add PrivateField to reviews/buildin_fields.py Clean up formatting caught by ReviewBot
Fix some typos and docstrings in review request model
~ 11/20/15
~ 11/20/15
Set Private button finally works! Clean up some formatting
~ 11/25/15
~ 11/25/15
Create a new button for making a review request no longer private and write the handler for it Make the existing button a little prettier
Remove debugging code
Fix issues raised in the last review request
~ 11/27/15
~ 11/27/15
Add very basic permissions for who can change the privacy status of a review request. This is done by hiding the set private button if the user is not a superuser or the submitter of the review request. + + 11/30/15
+ Add a basic check to see if the privacy status of the review request can be changed. The status cannot be changed if there are non-invite-only groups in the list of target review groups or if the user does not have the required editting permissions. If it cannot, the publish button gets greyed out. A warning is also logged to the console. + + Tested the new check mentioned above.
- Testing Done:
-
Test set private
To test the "set private" button, I selected an existing review request and clicked the button to set it to private. I then opened an icognito window to check that the private review request did not show up under "All Review Requests". I also tried to directly open a review request that was set to private by going directly to the URL in the incognito window and was greeted by a Permission Denied error. This validates the functionality.
Test unset private
To test the "unset private" button, I first set a review request to private. Then, verifying that it was correctly set to private, clicked the "unset private" button. I opened an incognito window to make sure the review request had once again appeared under "All Review Requests". Test basic permissions for changing privacy status
I tested the basic permissions with three scenarios. First I logged in on a superuser account and was able to set any review request to private, regardless of the submitter. The privacy buttons were not hidden in this case. Next I logged in to a regular account and was able to change the privacy status of review requests that were submitted by that account. The privacy buttons were not hidden in this case for review requests for which that account was not the submitter.
Finally I did not log in and was unable to change the privacy status of any review requests. The privacy buttons were always hidden in this case.
+ + Test set private when the review list contains non-invite-only review groups
+ I tested this by creating a review group that was not invite-only and adding the group to the reviewer list for a review request. I then tried to set the review request to private by clicking the "set private" button. When I did this, the "publish request" button was greyed out and an error was logged to the console. + + Using an alternate review request, I added a review group that was invite-only and was able to properly set the review request to private. I then signed in on an account where a user was a member of that invite-only review group and was able to view the review request on that account. This indicates that the functionality is working as intended.
- Diff:
-
Revision 14 (+241 -5)
- Added Files:
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request_draft.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/css/ui/buttons.less reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request_draft.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/css/ui/buttons.less reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
12/1/15
Add a toggle for the privacy lock icon so there is only one button instead of two. Now unlock icon will be shown when the review request can be set unprivate, meaning that the review request is currently private. If a review request is not private, a lock icon will be shown instead, indicating that the review request can be set to private. These icons will only be shown if the user already has the necessary permissions.Test the toggling for the new single button.
- Description:
-
Pre 11/13/15
Update accessibility for private review requests Fix issues raised in review request
Create a new field for private instead of using extra_data
Update _query for to filter private requests
Limit the permission to set a review request private to just the owner and super user
Fix error with setting private to F instead of T
11/13/15
Move new private field to BaseReviewRequestDetails model since it is used in both ReviewRequest and ReviewRequestDraft Update database evolutions accordingly
11/16/15
Experiment with different ways to set the private field to true 11/18/15
Add PrivateField to reviews/buildin_fields.py Clean up formatting caught by ReviewBot
Fix some typos and docstrings in review request model
11/20/15
Set Private button finally works! Clean up some formatting
11/25/15
Create a new button for making a review request no longer private and write the handler for it Make the existing button a little prettier
Remove debugging code
Fix issues raised in the last review request
11/27/15
Add very basic permissions for who can change the privacy status of a review request. This is done by hiding the set private button if the user is not a superuser or the submitter of the review request. 11/30/15
Add a basic check to see if the privacy status of the review request can be changed. The status cannot be changed if there are non-invite-only groups in the list of target review groups or if the user does not have the required editting permissions. If it cannot, the publish button gets greyed out. A warning is also logged to the console. Tested the new check mentioned above.
+ + 12/1/15
+ Add a toggle for the privacy lock icon so there is only one button instead of two. Now unlock icon will be shown when the review request can be set unprivate, meaning that the review request is currently private. If a review request is not private, a lock icon will be shown instead, indicating that the review request can be set to private. These icons will only be shown if the user already has the necessary permissions. + + Test the toggling for the new single button.
- Testing Done:
-
Test set private
To test the "set private" button, I selected an existing review request and clicked the button to set it to private. I then opened an icognito window to check that the private review request did not show up under "All Review Requests". + Next I set a particular review request to private and then logged in to the user account that submitted the review request. Using that account, I was still able to access the review request.
+ I also tried to directly open a review request that was set to private by going directly to the URL in the incognito window and was greeted by a Permission Denied error. This validates the functionality.
Test unset private
~ To test the "unset private" button, I first set a review request to private. Then, verifying that it was correctly set to private, clicked the "unset private" button. I opened an incognito window to make sure the review request had once again appeared under "All Review Requests". ~ To test the "unset private" button, I first set a review request to private. Then, verifying that it was correctly set to private, clicked the "unset private" button. I opened an incognito window to make sure the review request had once again appeared under "All Review Requests". I also logged into a user account to make sure a logged in user could also access the review request. Test basic permissions for changing privacy status
~ I tested the basic permissions with three scenarios. First I logged in on a superuser account and was able to set any review request to private, regardless of the submitter. The privacy buttons were not hidden in this case. ~ I tested the basic permissions with three scenarios. First I logged in on a superuser account and was able to set any review request to private, regardless of the submitter. The change privacy button was not hidden in this case. ~ Next I logged in to a regular account and was able to change the privacy status of review requests that were submitted by that account. The privacy buttons were not hidden in this case for review requests for which that account was not the submitter.
~ Next I logged in to a regular account and was able to change the privacy status of review requests that were submitted by that account. The change privacy button was hidden for review requests for which that account was not the submitter.
~ Finally I did not log in and was unable to change the privacy status of any review requests. The privacy buttons were always hidden in this case.
~ Finally I logged out and was unable to change the privacy status of any review requests. The privacy buttons were always hidden in this case.
Test set private when the review list contains non-invite-only review groups
I tested this by creating a review group that was not invite-only and adding the group to the reviewer list for a review request. I then tried to set the review request to private by clicking the "set private" button. When I did this, the "publish request" button was greyed out and an error was logged to the console. Using an alternate review request, I added a review group that was invite-only and was able to properly set the review request to private. I then signed in on an account where a user was a member of that invite-only review group and was able to view the review request on that account. This indicates that the functionality is working as intended.
+ + Test change privacy icon toggle
+ First I logged in on the superuser account to be able to change the privacy status of any review request. When selecting a particular review request, the single lock icon appeared, meaning that I could set the review request to private. I clicked the button and published the review request. After doing this, the lock icon turned into an unlock icon meaning that the review request was private and could be set to no longer private. - Diff:
-
Revision 15 (+244 -5)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request_draft.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/css/ui/buttons.less reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request_draft.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/css/ui/buttons.less reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js
-
-
- Change Summary:
-
Fix trailing white space
- Diff:
-
Revision 16 (+244 -5)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request_draft.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/css/ui/buttons.less reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request_draft.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/css/ui/buttons.less reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js
- Change Summary:
-
12/2/15
Allow review requests to be accessed by submitters and target people in the "All Review Requests" page. These were previously hidden due to the strictness of the private query. - Description:
-
Pre 11/13/15
Update accessibility for private review requests Fix issues raised in review request
Create a new field for private instead of using extra_data
Update _query for to filter private requests
Limit the permission to set a review request private to just the owner and super user
Fix error with setting private to F instead of T
11/13/15
Move new private field to BaseReviewRequestDetails model since it is used in both ReviewRequest and ReviewRequestDraft Update database evolutions accordingly
11/16/15
Experiment with different ways to set the private field to true 11/18/15
Add PrivateField to reviews/buildin_fields.py Clean up formatting caught by ReviewBot
Fix some typos and docstrings in review request model
11/20/15
Set Private button finally works! Clean up some formatting
11/25/15
Create a new button for making a review request no longer private and write the handler for it Make the existing button a little prettier
Remove debugging code
Fix issues raised in the last review request
11/27/15
Add very basic permissions for who can change the privacy status of a review request. This is done by hiding the set private button if the user is not a superuser or the submitter of the review request. 11/30/15
Add a basic check to see if the privacy status of the review request can be changed. The status cannot be changed if there are non-invite-only groups in the list of target review groups or if the user does not have the required editting permissions. If it cannot, the publish button gets greyed out. A warning is also logged to the console. Tested the new check mentioned above.
12/1/15
Add a toggle for the privacy lock icon so there is only one button instead of two. Now unlock icon will be shown when the review request can be set unprivate, meaning that the review request is currently private. If a review request is not private, a lock icon will be shown instead, indicating that the review request can be set to private. These icons will only be shown if the user already has the necessary permissions. Test the toggling for the new single button.
+ + 12/2/15
+ Allow review requests to be accessed by submitters and target people in the "All Review Requests" page. These were previously hidden due to the strictness of the private query. - Diff:
-
Revision 17 (+248 -7)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request_draft.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/css/ui/buttons.less reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/review_request.py reviewboard/reviews/evolutions/__init__.py reviewboard/webapi/resources/review_request_draft.py reviewboard/reviews/evolutions/review_request_draft_private.py reviewboard/reviews/models/review_request_draft.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/reviews/managers.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/evolutions/review_request_private.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/css/ui/buttons.less reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js
- Summary:
-
[WIP] Add permissions for private review request and update _query filterAdd functionality for private review requests
- Description:
-
~ Pre 11/13/15
~ Project Description
+ Today, review requests can be made private if they're filed against a private repository or invite-only review group. However, there's no way to make one private if you just want to assign it to specific people. + + This project would allow a review request to be marked as private. Private review requests will only be visible to those who are on the reviewer list.
+ + Only invite-only groups or individual users will be allowed as reviewers.
+ + It should be possible to make a public review request private, but only if the reviewers list meets the above criteria, and no other reviews have been made. It should be possible to make a review request public at any point.
+ + The API also needs to be updated to include a field representing whether the review request is private.
+ + Updates
+ Pre 11/13/15 Update accessibility for private review requests Fix issues raised in review request
Create a new field for private instead of using extra_data
Update _query for to filter private requests
Limit the permission to set a review request private to just the owner and super user
Fix error with setting private to F instead of T
11/13/15
Move new private field to BaseReviewRequestDetails model since it is used in both ReviewRequest and ReviewRequestDraft Update database evolutions accordingly
11/16/15
Experiment with different ways to set the private field to true 11/18/15
Add PrivateField to reviews/buildin_fields.py Clean up formatting caught by ReviewBot
Fix some typos and docstrings in review request model
11/20/15
Set Private button finally works! Clean up some formatting
11/25/15
Create a new button for making a review request no longer private and write the handler for it Make the existing button a little prettier
Remove debugging code
Fix issues raised in the last review request
11/27/15
Add very basic permissions for who can change the privacy status of a review request. This is done by hiding the set private button if the user is not a superuser or the submitter of the review request. 11/30/15
Add a basic check to see if the privacy status of the review request can be changed. The status cannot be changed if there are non-invite-only groups in the list of target review groups or if the user does not have the required editting permissions. If it cannot, the publish button gets greyed out. A warning is also logged to the console. Tested the new check mentioned above.
12/1/15
Add a toggle for the privacy lock icon so there is only one button instead of two. Now unlock icon will be shown when the review request can be set unprivate, meaning that the review request is currently private. If a review request is not private, a lock icon will be shown instead, indicating that the review request can be set to private. These icons will only be shown if the user already has the necessary permissions. Test the toggling for the new single button.
12/2/15
Allow review requests to be accessed by submitters and target people in the "All Review Requests" page. These were previously hidden due to the strictness of the private query.