MDL-48660 Availability: filter_user_list() should respect 'view hidden'

Updated filter_user_list to account for the viewhiddenactivities and
viewhiddensections capabilities.
This commit is contained in:
sam marshall
2015-01-27 12:02:28 +00:00
parent cccb0c0722
commit 848dd93bf2
6 changed files with 62 additions and 2 deletions
+6 -1
View File
@@ -139,7 +139,8 @@ abstract class tree_node {
/**
* Tests this condition against a user list. Users who do not meet the
* condition will be removed from the list.
* condition will be removed from the list, unless they have the ability
* to view hidden activities/sections.
*
* This function must be implemented if is_applied_to_user_lists returns
* true. Otherwise it will not be called.
@@ -150,6 +151,10 @@ abstract class tree_node {
* Within this function, if you need to check capabilities, please use
* the provided checker which caches results where possible.
*
* Conditions do not need to check the viewhiddenactivities or
* viewhiddensections capabilities. These are handled by
* core_availability\info::filter_user_list.
*
* @param array $users Array of userid => object
* @param bool $not True if this condition is applying in negative mode
* @param \core_availability\info $info Item we're checking