From 1e460fdfc2973ffe301388647de8e0f8afe7a36f Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Wed, 19 Sep 2007 07:29:31 +0000 Subject: [PATCH] accesslib: remove references to deprecated context_rel table and insert_context_rel() These references to the deprecated functions were erroring out. Remove them. Note however that other role related cleanups done as part of MDL-10679 "improvement to context_rel table and load_user_capability()" are kept. --- lib/accesslib.php | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/lib/accesslib.php b/lib/accesslib.php index e428aee4c0..bdb6e3784e 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -2435,15 +2435,6 @@ function delete_role($roleid) { delete_records('role_capabilities', 'roleid', $roleid); - // MDL-10679, delete from context_rel if this role holds the last override in these contexts - if ($contexts) { - foreach ($contexts as $context) { - if (!record_exists('role_capabilities', 'contextid', $context->contextid)) { - delete_records('context_rel', 'c1', $context->contextid); - } - } - } - delete_records('role_allow_assign', 'roleid', $roleid); delete_records('role_allow_assign', 'allowassign', $roleid); delete_records('role_allow_override', 'roleid', $roleid); @@ -2497,13 +2488,10 @@ function assign_capability($capability, $permission, $roleid, $contextid, $overw return update_record('role_capabilities', $cap); } else { $c = get_record('context', 'id', $contextid); - /// MDL-10679 insert context rel here - insert_context_rel ($c); return insert_record('role_capabilities', $cap); } } - /** * Unassign a capability from a role. * @param $roleid - the role id @@ -2516,16 +2504,7 @@ function unassign_capability($capability, $roleid, $contextid=NULL) { // delete from context rel, if this is the last override in this context $status = delete_records('role_capabilities', 'capability', $capability, 'roleid', $roleid, 'contextid', $contextid); - - // MDL-10679, if this is no more overrides for this context - // delete entries from context where this context is a child - if (!record_exists('role_capabilities', 'contextid', $contextid)) { - delete_records('context_rel', 'c1', $contextid); - } - } else { - // There is no need to delete from context_rel here because - // this is only used for legacy, for now $status = delete_records('role_capabilities', 'capability', $capability, 'roleid', $roleid); } -- 2.39.5