Hello! I'm writing a local plugin, which should observe certain event and then execute gradereport_overview_external::get_course_grades(). I've registered a callback function in events.php and declared it in observer.php:
│ ├── classes
│ │ └── observer.php
│ ├── db
│ │ └── events.php
Execution of get_course_grades leads to access error. So how can I give my plugin capabilities to execute this function? Should I open session somewhere in the callback function or what? Didn't find anything in docs. A few lines of code or links to the related place in docs would be very useful.