瀏覽代碼

Atualizar 'locallib.php'

Felipe-cavalieri 5 年之前
父節點
當前提交
d656b2f449
共有 1 個文件被更改,包括 10 次插入0 次删除
  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_