MDL-54035 accesslib: separate role definition cache clear

Thanks to MDL-49398, we can separate the combined user session and role
definition cache clearing function into two separate functions. At the
same time, we want to identify and remove mark_dirty() calls that were
added for role definition changes but were incorrectly left behind.

Change highlights:
 - Remove unnecessary mark_dirty() calls performed after
   assign_capability(), unassign_capability(), delete_role(),
   deleted contexts, brand new contexts
 - Move role definition cache clear from the user-centric
   accesslib_clear_all_caches() to the newly created,
   role-dedicated accesslib_reset_role_cache()
This commit is contained in:
Jonathan Champ
2018-09-21 09:17:42 -04:00
parent 6902f39141
commit b2f349a433
18 changed files with 31 additions and 66 deletions
-1
View File
@@ -254,7 +254,6 @@ class core_message_api_testcase extends core_message_messagelib_testcase {
// Remove the viewparticipants capability from one of the courses.
$course5context = context_course::instance($course5->id);
assign_capability('moodle/course:viewparticipants', CAP_PROHIBIT, $role->id, $course5context->id);
$course5context->mark_dirty();
// Perform a search.
list($contacts, $courses, $noncontacts) = \core_message\api::search_users($user1->id, 'search');