Open Kemmotar83 opened 4 years ago
What can also work is change this line to accept either guest or those with that capability.
https://github.com/kaltura/moodle_plugin/blob/MOODLE_37_DEV/mod/kalvidres/lti_launch.php#L42
if (!has_capability('mod/kalvidres:addinstance', $context) && !is_guest($context)) {
I'm not sure about that. That check excludes from viewing any authenticated user without mod/kalvidres:addinstance capability (ie. student). Am i wrong?
Giorgio
If you have guest access enabled shouldn’t is_guest() return true?
Sure, but that if statement is done to deny access and the boolean expression _!has_capability('mod/kalvidres:addinstance', $context) && !isguest($context) will include any user without mod/kalvidres:addinstance capability (is. Student) and that is not a guest. Guest will be able to view the resource but users with Student role will not.
Maybe I am missing something, but for it's just better to remove the if block and let Moodle manage authorizations.
Giorgio
We also need this problem solved. Has there been a resolution?
We are still applying my patch and we are "happy" with that.
Giorgio
Hi,
when in a course the Guest access (enrollment method) is enabled, guests are able to open the Kaltura Video Resource page (view.php) but the Kaltura Player shows the message The user hasn't the required capability to use this service.
I've checked and this message is shown to users due to a control made in /mod/kalvidres/lti_launch.php (line 42-45). For me this code block should be removed, since it works against expected activities' behavior. If teachers want to enable guest access to resources, Kaltura should show media as well.
Removing those 4 lines everything works as desired.
Thanks, Giorgio