Trying to add same access permission as a existing locked option gives error

Bug #1475104 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Robert Lyon
15.10
Fix Released
Undecided
Unassigned

Bug Description

When editing the access on a page such as Profile page if you try to add a 'registered users' access permission that is different to the locked one it throws error.

When in reality one shouldn't be able to even add an access permission of the same type if it has a locked instance.

Either we need to hide that option on page load or have some javascript check to say 'Hey no, that is not allowed'

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

I've added a patch that checks if any of the allowedpresets are in fact related to an access option that is locked or not and if it is locked then drop the preset from the list.

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/4973

Robert Lyon (robertl-9)
Changed in mahara:
status: Confirmed → In Progress
assignee: nobody → Robert Lyon (robertl-9)
Revision history for this message
Jinelle Foley-Barnes (jinelleb) wrote :

Hi,

Can I please have some test instructions for this one?

I just need it to be super clear what you can and cant see. So I can write a behat for it too.

Thanks,
Jinelle

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

To test - before patch:

1) Make new site with some users in it
2) Login as UserA
3) Go to 'Portfolio' and edit the 'Profile page'
4) Click 'Share page' and you should see that under the access rules 'Registered users' and the access start/end dates should be greyed out
- this means that UserA's profile page is shared with registered users by default and can't be changed
5) There is an 'add access for "registered users" option available.

But you shouldn't be as we can't change that access rule in any way.

After patch:

The 'add access for "registered users" option should not be available here - but it should be available when you are making a new page.

tags: added: needs-behat
removed: behat
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/4973
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/c1393bf907312b1030fa0961d9eb4241b2729cef
Submitter: Son Nguyen (<email address hidden>)
Branch: master

commit c1393bf907312b1030fa0961d9eb4241b2729cef
Author: Robert Lyon <email address hidden>
Date: Thu Jul 16 17:19:39 2015 +1200

Removing an access option from presets if there is a locked instance

Bug 1475104

To test:

Edit the access rules for a profile page

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

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
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.