Commit 0687eb9b6e0c75197b339c5a5df5fd8ca7135f12
1 parent
51ca23d7
-Is admin
Showing
1 changed file
with
13 additions
and
0 deletions
Show diff stats
common/models/User.php
@@ -226,4 +226,17 @@ | @@ -226,4 +226,17 @@ | ||
226 | { | 226 | { |
227 | return $this->hasOne(UserPassport::className(), [ 'user_id' => 'id' ]); | 227 | return $this->hasOne(UserPassport::className(), [ 'user_id' => 'id' ]); |
228 | } | 228 | } |
229 | + | ||
230 | + /** | ||
231 | + * @return bool | ||
232 | + * @todo change this | ||
233 | + */ | ||
234 | + public function isAdmin() | ||
235 | + { | ||
236 | + if ($this->id == 1) { | ||
237 | + return true; | ||
238 | + } else { | ||
239 | + return false; | ||
240 | + } | ||
241 | + } | ||
229 | } | 242 | } |