Moodle

review use of moodle/user:viewuseractivitiesreport and add risk

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9.4
  • Component/s: Roles / Access
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

1/ it is used incorrectly in course context
2/ it does not make sense to set it for any legacy role - intended for parents only
3/ missing RISK_PERSONAL

Activity

Hide
Tim Hunt added a comment -

Petr, just for your information, I recently added a function ensure_context_subobj_present to accesslib, which lets you replace code like

if (isset($user->context->id)) {
$usercontext = $user->context;
} else {
$usercontext = get_context_instance(CONTEXT_USER, $user->id);
}

with

ensure_context_subobj_present($user, CONTEXT_USER);
$usercontext = $user->context;

Show
Tim Hunt added a comment - Petr, just for your information, I recently added a function ensure_context_subobj_present to accesslib, which lets you replace code like if (isset($user->context->id)) { $usercontext = $user->context; } else { $usercontext = get_context_instance(CONTEXT_USER, $user->id); } with ensure_context_subobj_present($user, CONTEXT_USER); $usercontext = $user->context;
Hide
Tim Hunt added a comment -

Reviewed code and tested. Looks good to me. Thanks.

Show
Tim Hunt added a comment - Reviewed code and tested. Looks good to me. Thanks.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: