From 0687eb9b6e0c75197b339c5a5df5fd8ca7135f12 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 30 Dec 2016 13:30:39 +0200 Subject: [PATCH] -Is admin --- common/models/User.php | 13 +++++++++++++ 1 file changed, 13 insertions(+), 0 deletions(-) diff --git a/common/models/User.php b/common/models/User.php index 2aacddf..d388f50 100755 --- a/common/models/User.php +++ b/common/models/User.php @@ -226,4 +226,17 @@ { return $this->hasOne(UserPassport::className(), [ 'user_id' => 'id' ]); } + + /** + * @return bool + * @todo change this + */ + public function isAdmin() + { + if ($this->id == 1) { + return true; + } else { + return false; + } + } } -- libgit2 0.21.4