user id and role is handled by session
This commit is contained in:
1 parent
2d133598e8
commit
020bdc8c89
1 file changed
+2
-2
@@ -20,8 +20,8 @@ class NotesController
|
||||
{
|
||||
$sortBy = $_GET['sort_by'] ?? 'updated_at';
|
||||
$sortOrder = strtoupper($_GET['sort_order'] ?? 'DESC');
|
||||
$isAdmin = false;
|
||||
$userid = 2; //$_SESSION['user_id'];
|
||||
$isAdmin = $_SESSION['role'] === 'admin';
|
||||
$userid = $_SESSION['user_id'];
|
||||
|
||||
$this->view->setVars([
|
||||
"notes" => $this->notesModel->selectNotesForUser($userid, $isAdmin, $sortBy, $sortOrder)
|
||||
|
||||
Reference in new issue
Block a user