[MGNLPER-173] JcrSearchResultSupplier should consider users access Created: 31/Aug/22  Updated: 18/Apr/23  Resolved: 18/Apr/23

Status: Closed
Project: Periscope
Component/s: None
Affects Version/s: 1.2.4
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Richard Gange Assignee: Miguel Martinez
Resolution: Obsolete Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 0.25h
Original Estimate: Not Specified

Issue Links:
relation
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: [JCR] Search Performance issues
Story Points: 5
Team: AuthorX

 Description   

Only search folders where the current user has READ rights. Don't suggest items which the user cannot access anyway.

Measure and record the times before the change and after the change in this ticket using the big data environment.

We have a common place for the metrics here: https://www.notion.so/magnoliacms/Monitoring-and-tracking-metrics-d6c3037f7a584aa79911ecaf3d3bd22f

Notes
Add multisite option to JcrSearchResultSupplier.



 Comments   
Comment by Miguel Martinez [ 18/Apr/23 ]

The current user is already being in consideration in the latests versions, this mecanism is provided by JCR and the sessions as is here 

final Session session = contextProvider.get().getJCRSession(definition.getWorkspace()); 

When we administer session to the query we are already setting behind the scenes the session, the users and it's ACLS
For this to happen always, it was done a fix in the past about forcing the session to be provided in the code that is the User session not the system version
Like in the section of the code that Periscope calls the JcrSupplier 

public SearchRunBatch search(SearchQuery searchQuery, Collection<SearchResultSupplier> suppliersToSearchIn) {
    AsynchronousContext.OperationFactory asynchronousContext = asynchronousContextOperationProvider.get();
    return searchRunner.execute(suppliersToSearchIn, supplier -> {
                try {
                    return asynchronousContext.wrap(() -> fetchSupplierAwareSearchResults(searchQuery, supplier)).call();
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
    );
} 

 

Generated at Mon Feb 12 10:29:27 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.