Relax related issue rules for restricted issues#1249
Relax related issue rules for restricted issues#1249labkey-klum merged 9 commits intorelease24.11-SNAPSHOTfrom
Conversation
labkey-sweta
left a comment
There was a problem hiding this comment.
gotoProjectHome()
impersonate()
waitAndClickAndWait();
need this update in most of the place.
| import java.util.Collections; | ||
| import java.util.List; | ||
|
|
||
| @Category({CustomModules.class, EHR.class, ONPRC.class}) |
There was a problem hiding this comment.
@labkey-tchad Do we need CustomModule.EHR for this test to run in ONPRC module?
There was a problem hiding this comment.
CustomModules.class should be removed from all of the EHR tests.
| @Test | ||
| public void restrictedIssueTest() | ||
| { | ||
| clickProject(getProjectName()); |
There was a problem hiding this comment.
goToProjectHome(); would do the same thing.
There was a problem hiding this comment.
I don't have a particular preference but the difference is that clickProject uses the project menu while goToProjectHome navigates directly to <containerPath>/project-begin.view.
|
|
||
| // create a few issues in the restricted list | ||
| impersonate(ISSUE_CREATOR.getEmail()); | ||
| clickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST)); |
There was a problem hiding this comment.
waitAndClickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST));
There was a problem hiding this comment.
doesn't goToProjectHome() on line 98 wait for up to 60 seconds for the page to load?
There was a problem hiding this comment.
waitAndClick/waitAndClickAndWait are only necessary if the link takes a moment to appear after the page has loaded (probably not necessary here)
| stopImpersonating(); | ||
|
|
||
| // verify site admins can see both issues (but not folder admins) | ||
| clickProject(getProjectName()); |
|
|
||
| // verify site admins can see both issues (but not folder admins) | ||
| clickProject(getProjectName()); | ||
| clickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST)); |
There was a problem hiding this comment.
waitAndClickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST));
| verifyIssueAccess(ISSUE_2, true); | ||
|
|
||
| impersonate(FOLDER_ADMIN.getEmail()); | ||
| clickProject(getProjectName()); |
There was a problem hiding this comment.
Shouldnt it be ?
gotoProjectHome();
impersonate(FOLDER_ADMIN.getEmail());
waitAndClickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST));
There was a problem hiding this comment.
Does it matter? Either should be starting from the project begin URL?
| stopImpersonating(); | ||
|
|
||
| // creators can see all of the issues they opened | ||
| impersonate(ISSUE_CREATOR.getEmail()); |
There was a problem hiding this comment.
Same comment as above
| stopImpersonating(); | ||
|
|
||
| // users can view issues assigned to them | ||
| impersonate(USER1.getEmail()); |
| impersonate(FOLDER_ADMIN.getEmail()); | ||
| clickProject(getProjectName()); | ||
| clickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST)); | ||
| verifyIssueAccess(ISSUE_1, false); |
There was a problem hiding this comment.
Folder admin don't have access to issues?
There was a problem hiding this comment.
Not to a restricted issue, only site admins are allowed.
|
|
||
| // create 2 issues related to each other | ||
| impersonate(ISSUE_CREATOR.getEmail()); | ||
| clickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST)); |
There was a problem hiding this comment.
gotoProjectHome()
impersonate()
waitAndClickAndWait();
labkey-sweta
left a comment
There was a problem hiding this comment.
Automation looks good
Rationale
This changes how related issues are handled for restricted issues. Previously, a user was required to have access to all related issues in order to view an issues details. With this change, related issues will behave equivalently to those in an unrestricted list. A user will still be able to view the details of an issue but will not see any related issues they do not have access to (other than the ID of said related issue(s)).
This also adds automated tests to validate the desired behavior for restricted issue lists.
Related Pull Requests