Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Bug #995 (closed)

Opened 16 years ago

Closed 16 years ago

Search Filter by owner

Reported by: jburel Owned by: jamoore
Priority: blocker Cc:
Sprint: n.a.
Total Remaining Time: n.a.

Description

I am doing a basic search on the name of the images

Search service = getSearchService();
service.setAllowLeadingWildcard(true);
service.onlyOwnedBy(exp.asExperimenter().getDetails()); where exp = me
service.onlyType(Image.class)
service.bySomeMustNone(some, must, none); where some = [*API*]

I found images but I am NOT the owner of the returned images.

Change History (3)

comment:1 Changed 16 years ago by jmoore

  • Status changed from new to assigned

Jean-Marie, can you verify that this is the problem we're talking about? The following passes currently.

    @Test(groups = "ticket:955")
    public void testIssueOnlyOwnedByReturnsWrongContent() {

        // Create user which will own the image.
        String uuid = uuid();
        Experimenter owner = loginNewUser();
        Details d_owner = Details.create();
        d_owner.setOwner(owner);

        // Add an image as the owner
        Image i = new Image();
        i.setName("Some text " + uuid + " blah blah");
        i = this.iUpdate.saveAndReturnObject(i);

        loginRoot();
        this.iUpdate.indexObject(i);

        // Now login as another user who doesn't own that image
        Experimenter searcher = loginNewUser();
        Details d_searcher = Details.create();
        d_searcher.setOwner(searcher);

        Search search = this.factory.createSearchService();
        search.setAllowLeadingWildcard(true);
        search.onlyOwnedBy(d_searcher);
        search.onlyType(Image.class);

        // We shouldn't find any results
        search.bySomeMustNone(new String[] { "*" + uuid + "*" }, null, null);
        assertResults(search, 0);
        search.bySomeMustNone(new String[] { "*blah blah*" }, null, null);
        assertResults(search, 0);

        // Now let's change to the owner and see the results
        search.onlyOwnedBy(d_owner);
        search.bySomeMustNone(new String[] { "*" + uuid + "*" }, null, null);
        assertResults(search, 1);
        search.bySomeMustNone(new String[] { "*blah blah*" }, null, null);
        assertResults(search, 1);

    }

comment:2 Changed 16 years ago by jmoore

r2450 contains the test.

comment:3 Changed 16 years ago by jmoore

  • Resolution set to fixed
  • Status changed from assigned to closed

Closing. This seems to be a documentation error on my part. It needs to be clear that: onlyOwnedBy(Details) expects a new Details instance with the Owner set, as opposed to:

  onlyOwnedBy( someExperimenter.getDetails() );

See #997 for further work on this.

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.66191 sec.)

We're Hiring!