Skip to content

Relax related issue rules for restricted issues#1249

Merged
labkey-klum merged 9 commits intorelease24.11-SNAPSHOTfrom
24.11_fb_restricted_issue
Feb 14, 2025
Merged

Relax related issue rules for restricted issues#1249
labkey-klum merged 9 commits intorelease24.11-SNAPSHOTfrom
24.11_fb_restricted_issue

Conversation

@labkey-klum
Copy link
Copy Markdown
Contributor

@labkey-klum labkey-klum commented Feb 9, 2025

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

Copy link
Copy Markdown
Contributor

@labkey-sweta labkey-sweta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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})
Copy link
Copy Markdown
Contributor

@labkey-sweta labkey-sweta Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@labkey-tchad Do we need CustomModule.EHR for this test to run in ONPRC module?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CustomModules.class should be removed from all of the EHR tests.

@Test
public void restrictedIssueTest()
{
clickProject(getProjectName());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

goToProjectHome(); would do the same thing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

waitAndClickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't goToProjectHome() on line 98 wait for up to 60 seconds for the page to load?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotoProjectHome();


// verify site admins can see both issues (but not folder admins)
clickProject(getProjectName());
clickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

waitAndClickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST));

verifyIssueAccess(ISSUE_2, true);

impersonate(FOLDER_ADMIN.getEmail());
clickProject(getProjectName());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldnt it be ?
gotoProjectHome();
impersonate(FOLDER_ADMIN.getEmail());
waitAndClickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above

stopImpersonating();

// users can view issues assigned to them
impersonate(USER1.getEmail());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

impersonate(FOLDER_ADMIN.getEmail());
clickProject(getProjectName());
clickAndWait(Locator.linkContainingText(RESTRICTED_ISSUES_LIST));
verifyIssueAccess(ISSUE_1, false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Folder admin don't have access to issues?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotoProjectHome()
impersonate()
waitAndClickAndWait();

Copy link
Copy Markdown
Contributor

@labkey-sweta labkey-sweta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automation looks good

@labkey-klum labkey-klum merged commit 50e6b2d into release24.11-SNAPSHOT Feb 14, 2025
@labkey-klum labkey-klum deleted the 24.11_fb_restricted_issue branch February 14, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants