Elastic Search does not find media in a group

Bug #1237177 reported by Ghada El-Zoghbi on 2013-10-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Medium
Ghada El-Zoghbi
1.8
Medium
Unassigned
1.9
Medium
Ghada El-Zoghbi

Bug Description

Version: Mahara 1.8rc2dev
DB: PostGres
Vanilla install.

(but also same issue with MySql Elastic search on my local changes for Palnet - v1.4 upgraded to 1.8).

Create a document under a group with all permissions enabled (Admin and Member: view, edit, public ticked).

Once the cron job has run, the search cannot find the file.

If you create a group page with the same document embeded and share the page, the search will find the file.

Ghada El-Zoghbi (ghada-z) wrote :
Ghada El-Zoghbi (ghada-z) wrote :
Aaron Wells (u-aaronw) on 2013-10-09
Changed in mahara:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 1.8.1
Aaron Wells (u-aaronw) wrote :

Hi Ghada,

Thanks for the bug report!

By the way, would you mind upstreaming your MySQL port of Elasticsearch? I've filed a bug for it here: https://bugs.launchpad.net/mahara/+bug/1237198

I was planning to hold that off until 1.9.0, but if you've got it ready now we could include it in 1.8.0, which would be great.

Cheers,
Aaron

Hi Aaron,

Thanks for creating the bug for the MySql Elastic search. I've been
very nervous/scared to actually push it upstream (silly, I know).

I'll get on it right away...

Thanks,
Ghada

On 09/10/13 15:33, Aaron Wells wrote:
> Hi Ghada,
>
> Thanks for the bug report!
>
> By the way, would you mind upstreaming your MySQL port of Elasticsearch?
> I've filed a bug for it here:
> https://bugs.launchpad.net/mahara/+bug/1237198
>
> I was planning to hold that off until 1.9.0, but if you've got it ready
> now we could include it in 1.8.0, which would be great.
>
> Cheers,
> Aaron
>

--
Ghada El-Zoghbi
Catalyst IT
<email address hidden>
tel:+61-2-8011-0625
www.catalyst-au.net

CONFIDENTIALITY NOTICE: This email is intended for the named recipients only. It may contain privileged, confidential or copyright information. If you are not the named recipients, any use, reliance upon, disclosure or copying of this email or any attachments is unauthorised. If you have received this email in error, please reply via email or telephone +61 2 8004 5928.

Aaron Wells (u-aaronw) wrote :

No worries, I understand code review can be a little intimidating. :)

Robert Lyon (robertl-9) on 2013-10-10
Changed in mahara:
status: Triaged → Confirmed
Robert Lyon (robertl-9) wrote :

From what I found by testing:

Create a group page with a document embeded and all permissions enabled (Admin and Member: view, edit, public ticked).

- If you share that page with the group the search will NOT find the file.

- If you share that page with 'logged in users' the search will find the file.

Robert Lyon (robertl-9) wrote :

Ok from what I can work out the ElasticsearchType_artefact::getRecordById() only checks for access attached to a view.

And group files are not attached to a view so can't be seen.

One can see files in Content -> Files because the files have an owner id set but not in Group -> [groupname] -> Files because they don't have an owner.

So I think we need to check if artefact has no owner but has a group id and then get who is allowed to view artefact and add that to its access array.

Does that sound like what the problem is?

Ghada El-Zoghbi (ghada-z) wrote :

Hi Robert,

Yes, I believe that is the problem.

Thanks,
Ghada

On 11/10/13 08:24, Robert Lyon wrote:
> then get who is allowed to view artefact and

--
Ghada El-Zoghbi
Catalyst IT
<email address hidden>
tel:+61-2-8011-0625
www.catalyst-au.net

CONFIDENTIALITY NOTICE: This email is intended for the named recipients only. It may contain privileged, confidential or copyright information. If you are not the named recipients, any use, reliance upon, disclosure or copying of this email or any attachments is unauthorised. If you have received this email in error, please reply via email or telephone +61 2 8004 5928.

Changed in mahara:
assignee: nobody → Ghada El-Zoghbi (ghada-z)
Ghada El-Zoghbi (ghada-z) wrote :

Note:

I don't quite understand all the details of the elastic search. But, for some reason the access for groups['all'] is getting ignored.

When the role is 'all', I'm explicity setting the access for groups['member'] and groups['admin'] as well as groups['all'].

Perhaps there's a better way to fix this?

Ghada El-Zoghbi (ghada-z) wrote :

Code uploaded for review (for version 1.9.0dev):

https://reviews.mahara.org/2682

Changed in mahara:
status: Confirmed → In Progress
Robert Lyon (robertl-9) wrote :

Hi Ghada,

Your patch looks to fix the problem when artefacts are attached to a view so that now group members can find the artefact via search.

But it does not address the problem where group files are not attached to a view.

I've added a patch (dependent on yours) that checks unattached group files against the artefact_access_role table to see if members / admins can view them.

https://reviews.mahara.org/#/c/2690/

Reviewed: https://reviews.mahara.org/2682
Committed: http://gitorious.org/mahara/mahara/commit/730f8b278dbbd93e54f8efa5adf2652d0bc852a5
Submitter: Son Nguyen (<email address hidden>)
Branch: master

commit 730f8b278dbbd93e54f8efa5adf2652d0bc852a5
Author: Ghada El-Zoghbi <email address hidden>
Date: Mon Nov 4 17:14:44 2013 +1100

bug1237177: Elasticsearch does not find media in a group.

Access for 'all' is not getting found for groups. Explicitly setting the 'member' and 'admin' access for the group.

Change-Id: Iae37087d0ffc7df50fad9d62a2264b474d5a1b4e
Signed-off-by: Ghada El-Zoghbi <email address hidden>

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2690
Committed: http://gitorious.org/mahara/mahara/commit/4d7e58615ff032627257e9198146a953ad0ad9ba
Submitter: Son Nguyen (<email address hidden>)
Branch: master

commit 4d7e58615ff032627257e9198146a953ad0ad9ba
Author: Robert Lyon <email address hidden>
Date: Thu Nov 7 11:51:22 2013 +1300

Elasticsearch not finding unattached group artefacts (bug #1237177)

- items in group -> files not being found if they are not attached to
a view

- added code so that unattached group artefacts can be checked against
the artefact_access_role table (currently only used for group
artefacts) to see what roles they can be viewed by

Change-Id: I17eb03241e10e44460c0596c3d982c00dd39f336
Signed-off-by: Robert Lyon <email address hidden>

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2811
Committed: http://gitorious.org/mahara/mahara/commit/cca3d8266fbc154d08f41df989908ba790ef7aeb
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE

commit cca3d8266fbc154d08f41df989908ba790ef7aeb
Author: Ghada El-Zoghbi <email address hidden>
Date: Mon Nov 4 17:14:44 2013 +1100

bug1237177: Elasticsearch does not find media in a group.

Access for 'all' is not getting found for groups. Explicitly setting the 'member' and 'admin' access for the group.

Change-Id: Iae37087d0ffc7df50fad9d62a2264b474d5a1b4e
Signed-off-by: Ghada El-Zoghbi <email address hidden>

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2812
Committed: http://gitorious.org/mahara/mahara/commit/810fbc8eff3160595573e57668ad95ef3b97a274
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE

commit 810fbc8eff3160595573e57668ad95ef3b97a274
Author: Robert Lyon <email address hidden>
Date: Thu Nov 7 11:51:22 2013 +1300

Elasticsearch not finding unattached group artefacts (bug #1237177)

- items in group -> files not being found if they are not attached to
a view

- added code so that unattached group artefacts can be checked against
the artefact_access_role table (currently only used for group
artefacts) to see what roles they can be viewed by

Change-Id: I17eb03241e10e44460c0596c3d982c00dd39f336
Signed-off-by: Robert Lyon <email address hidden>

Aaron Wells (u-aaronw) on 2013-12-18
Changed in mahara:
status: Fix Committed → Fix Released
Robert Lyon (robertl-9) on 2014-04-22
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers