diff --git a/application/models/project.php b/application/models/project.php
index e6636ce..a2d7d3e 100644
--- a/application/models/project.php
+++ b/application/models/project.php
@@ -98,7 +98,11 @@ class Project extends CI_Model {
* @param string $userId
* @return array All accessible projects
*/
- public function getAccessible($userId) {
+ public function getAccessible($userId = '') {
+ if (empty($userId)) {
+ $userId = $this->session->userdata('user_id');
+ }
+
$shares = array();
$query = $this->db->get_where('shares', array('user_id' => $userId));
foreach ($query->result_array() as $share) {
diff --git a/application/views/header.php b/application/views/header.php
index 212d214..ebc86a6 100644
--- a/application/views/header.php
+++ b/application/views/header.php
@@ -51,7 +51,12 @@
project->getAll() as $project):
+ if ($this->access->isAdmin()) {
+ $theProjects = $this->project->getAll();
+ } else {
+ $theProjects = $this->project->getAccessible();
+ }
+ foreach ($theProjects as $project):
?>