List of shared pages to a group not taking account of access date

Bug #1374163 reported by Son Nguyen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Aaron Wells
1.10
Won't Fix
Medium
Unassigned
15.04
Fix Released
Medium
Aaron Wells
15.10
Fix Released
Medium
Aaron Wells

Bug Description

Version: master(1.10) and previous version
Browser, platform: any

When I clicked a shared page in the list of shared pages in the group homepage (htdocs/group/view.php), I got "Access denied" message.
Steps

1. Login as user A, create a page, share the page to a group Z
2. Set the 'Overriding start date' to a future date
3. Login as a member of group Z
4. In the group Z homepage, click the page shared by the user A
You will see the "Access denied" message.

Expected result: The page shared by the user A to the group Z should not be displayed in the list until the date set by 'Overriding start date'

Son Nguyen (ngson2000)
description: updated
Robert Lyon (robertl-9)
Changed in mahara:
status: New → Confirmed
summary: - List of shared page to a group is not correct
+ List of shared pages to a group not taking account of access date
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Alternatively, add a note that the page is only accessible from [date] on.

Changed in mahara:
importance: Undecided → Medium
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Which way to go needs to be looked at in general when sharing a page that is only accessible in the future (and up to a certain date).

Aaron Wells (u-aaronw)
tags: added: groups regression
no longer affects: mahara/1.0
tags: added: behat needs-behat
Revision history for this message
Aaron Wells (u-aaronw) wrote :

Not actually a regression as far as I can tell. This bug has been present since at least Mahara 1.7.

tags: removed: regression
Revision history for this message
Aaron Wells (u-aaronw) wrote :

Other places that show lists of pages do not exhibit this behavior: the "Latest pages" block, the "Shared with me" screen. It's just the Group Pages block that shows you these pages you don't yet have access to.

Revision history for this message
Aaron Wells (u-aaronw) wrote :

I've pushed a patch up to gerrit. We made a lot of changes in the Group Pages block in 15.04, so this patch won't cherry-pick cleanly to 1.10 and earlier. So I'm marking those branches "Won't Fix" because this is only a medium bug.

Keeping the priority at medium, because I don't think access start and end dates are a heavily-used feature. But nonetheless this would be a good bug to fix in 15.04.1, because it does lead to a visible error message for the user.

Revision history for this message
Aaron Wells (u-aaronw) wrote :

In implementing this I noticed that at some point we added code to the get_sharedviews_data() method that checks the start and end date for the group's view_access record. But, we were still missing code to check the overriding start and end date (which is stored in view.startdate and view.enddate). We also had no code to check for collections to check for any of the start and end dates.

My patch fixes all of these scenarios. So, to test this patch fully, you'll need to create and share pages and collections with a group, with future start dates and past end dates, on both the group access line and the total page access line. In all there are 8 permutations, plus it's good to add another 2 without start and end dates to make sure they still show up.

1. Create Group Z

2. Create these pages, and share them with the Group Z. (In order to create past end dates, the easiest thing is to set an end date 1 day in the future, then move your system clock forward 1 week. This is obviously not possible in Behat, so for automated testing we can just skip testing the past end dates. Or do a direct database update.)

- Page 1: future start date on group access
- Page 2: past end date on group access
- Page 3: future start date on total page access
- Page 4: past end date on total page access
- Page 5: no start/end date
- Collection 1: future start date on group access
- Collection 2: past end date on group access
- Collection 3: future start date on total page access
- Collection 4: past end date on total page access
- Collection 5: no start/end date

3. Make sure Group Z's homepages has a "Group Pages" block on it, and that it is set to display pages and collections shared with the group.

4. View Group Z's homepage

Expected Result: You should only see Page 5 and Collection 5.

Actual Result: You see Pages 3, 4, and 5, and Collections 1, 2, 3, 4, and 5.

Revision history for this message
Robert Lyon (robertl-9) wrote :

I see the hook that adds the patch url failed to add it here. Something to look into at some point :)

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Thanks for the heads-up. I was noticing that it was a bit slow on Friday, but it looks like it's so slow it never happened at all.

I've filed a bug about it here: https://bugs.launchpad.net/mahara/+bug/1455993

Revision history for this message
Aaron Wells (u-aaronw) wrote :
Revision history for this message
Son Nguyen (ngson2000) wrote :

I'll write a behat test for this bug

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "15.04_STABLE" branch: https://reviews.mahara.org/4775

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/4775
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/87c06e8ca60121e1cf7958f6a54485a469561270
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.04_STABLE

commit 87c06e8ca60121e1cf7958f6a54485a469561270
Author: Aaron Wells <email address hidden>
Date: Sun May 17 17:11:21 2015 +1200

Bug 1374163: Make "Group Pages" block aware of access start/end dates

Change-Id: I94adfb0ad3cb6c0ce7e2cddf31b06ca7ec878420
(cherry picked from commit 67918f4db4a42998f689d6d090086cdb725e4f37)

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/4783

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/4783
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/10a3d7a3d610d0302d7fcd14cbdd3e4bfb21fdda
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 10a3d7a3d610d0302d7fcd14cbdd3e4bfb21fdda
Author: Son Nguyen <email address hidden>
Date: Fri May 22 08:55:38 2015 +1200

Behat test: Share pages and collections to a group (Bug 1374163)

Change-Id: I4f67f891793ed8b16d29698394b30ef98d2f6e9a

Son Nguyen (ngson2000)
no longer affects: mahara/1.9
no longer affects: mahara/1.8
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.