← Back to team overview

mahara-contributors team mailing list archive

[Bug 620170] Re: Merge/simplify view access records

 

This is mostly done in the set_access function apart from merging date
ranges & the more complicated rules.   Will leave these till a later
release as they are lower priority.

** Changed in: mahara
   Importance: Medium => Low

** Changed in: mahara
     Assignee: Richard Mansfield (richard-mansfield) => (unassigned)

** Changed in: mahara
    Milestone: 1.3.0 => None

-- 
Merge/simplify view access records
https://bugs.launchpad.net/bugs/620170
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.

Status in Mahara ePortfolio: Confirmed

Bug description:
We need a good function to take a bunch of view access records and simpify them down to a sensible minimal set.  This has always been a bit of a problem, but it will become worse now that we are merging sets of access records when adding views to collections.

The process for rationalising the access rules should be something like this:

- Remove any records with a stop date in the past
- Remove start dates that are in the past from all records
- If the view allows comments, set allowcomments/approvecomments on all access records to the default (0/1)
- If any two records are identical apart from start/stop dates, and their date ranges overlap, merge them to one with the minimum start date and maximum stop date
- Remove any identical duplicates



There are a bunch of other simplifications that could be done, but I'd rather leave them alone for now because someone might have a use for them.  For example:
- If there's a public access record, we could remove all other records with a date range included in the public access date range,
- If there's a logged-in access record, we could remove all other records except public with a date range included in the logged-in access date range,
- If there's a 'whole group' access record, we could remove all group role access records for the same group with a date range included in the whole group access date range,
etc.


For now, we should also make sure this process doesn't mess with invisible access records.





References