Jelajahi Sumber

Atualizar 'locallib.php'

Felipe-cavalieri 5 tahun lalu
induk
melakukan
d656b2f449
1 mengubah file dengan 10 tambahan dan 0 penghapusan
  1. 10 0
      locallib.php

+ 10 - 0
locallib.php

@@ -2,7 +2,17 @@
 
 namespace gradeimporter;
 
+
+use context_user;
+
 class feedback {
+  	public static function is_capability() {
+        global $USER;
+
+        $usercontext = context_user::instance($USER->id);
+        return has_capability('moodle/course:update', $usercontext);
+    }
+  
     public static function get_comments() {
         global $DB, $USER, $CFG;
         $tp = $CFG->prefix; // gets moodle tables prefix, not everyone uses mdl_