Browse Source

Fix perrmissions to show link to assign badge - refs BT#12085

Angel Fernando Quiroz Campos 8 years ago
parent
commit
a9bf331754
1 changed files with 7 additions and 4 deletions
  1. 7 4
      main/mySpace/myStudents.php

+ 7 - 4
main/mySpace/myStudents.php

@@ -367,10 +367,13 @@ if (!empty($student_id)) {
             Display::return_icon('login_as.png', get_lang('LoginAs'), null, ICON_SIZE_MEDIUM).'</a>&nbsp;&nbsp;';
     }
 
-    echo Display::url(
-        Display::return_icon('skill-badges.png', get_lang('AssignSkill'), null, ICON_SIZE_MEDIUM),
-        api_get_path(WEB_CODE_PATH) . 'badge/assign.php?' . http_build_query(['user' => $student_id])
-    );
+    if (api_is_platform_admin(false, true) || api_is_student_boss()) {
+        echo Display::url(
+            Display::return_icon('skill-badges.png', get_lang('AssignSkill'), null, ICON_SIZE_MEDIUM),
+            api_get_path(WEB_CODE_PATH) . 'badge/assign.php?' . http_build_query(['user' => $student_id])
+        );
+    }
+
     echo '</div>';
 
     // is the user online ?