diff options
Diffstat (limited to 'app/Model/UserSession.php')
-rw-r--r-- | app/Model/UserSession.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/Model/UserSession.php b/app/Model/UserSession.php index 44a9c2a2..1ae3fdf4 100644 --- a/app/Model/UserSession.php +++ b/app/Model/UserSession.php @@ -34,6 +34,7 @@ class UserSession extends Base $user['id'] = (int) $user['id']; $user['is_admin'] = (bool) $user['is_admin']; + $user['is_project_admin'] = (bool) $user['is_project_admin']; $user['is_ldap_user'] = (bool) $user['is_ldap_user']; $user['twofactor_activated'] = (bool) $user['twofactor_activated']; @@ -74,6 +75,17 @@ class UserSession extends Base } /** + * Return true if the logged user is project admin + * + * @access public + * @return bool + */ + public function isProjectAdmin() + { + return isset($this->session['user']['is_project_admin']) && $this->session['user']['is_project_admin'] === true; + } + + /** * Get the connected user id * * @access public |