Skip to content
Snippets Groups Projects
Commit 7f59cdd0 authored by Kurniandha Sukma Yunastrian's avatar Kurniandha Sukma Yunastrian
Browse files

fix role permission show grade

parent c1b55084
2 merge requests!8Finalize,!7Finalize Integration
...@@ -145,6 +145,10 @@ class CourseController extends Controller ...@@ -145,6 +145,10 @@ class CourseController extends Controller
* @return grade * @return grade
*/ */
public function grade($id_course) { public function grade($id_course) {
if (Auth::user()->role == 0) {
return redirect()->route('course', ['id_course' => $id_course, 'msg' => 6]);
}
$enrolled_id = DB::table('user_course')->where('id_course', $id_course)->pluck('id_user'); $enrolled_id = DB::table('user_course')->where('id_course', $id_course)->pluck('id_user');
$topics = DB::table('topics')->where('id_course', $id_course)->get(); $topics = DB::table('topics')->where('id_course', $id_course)->get();
......
...@@ -255,8 +255,10 @@ ...@@ -255,8 +255,10 @@
@foreach($students as $student) @foreach($students as $student)
{{ $student }} <br/> {{ $student }} <br/>
@endforeach @endforeach
<br/> @if(Auth::user()->role == 1)
<a href="<?php echo $topic->id_course; ?>/grade" class="btn btn-primary" role="button">Lihat Nilai</a> <br/>
<a href="<?php echo $topic->id_course; ?>/grade" class="btn btn-primary" role="button">Lihat Nilai</a>
@endif
</div> </div>
</div> </div>
</div> </div>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment