diff options
| author | Frédéric Guillot <fred@kanboard.net> | 2014-10-05 12:32:44 -0400 |
|---|---|---|
| committer | Frédéric Guillot <fred@kanboard.net> | 2014-10-05 12:32:44 -0400 |
| commit | 7f5a871f84639a90eebd0ac1d0ee7f759e220cf6 (patch) | |
| tree | f814b2fa2ae888d0b2e800f14c6c8d6b75e85428 /app/Model/User.php | |
| parent | bae57838c2dd789064b246308c7cb3a33bba5b8e (diff) | |
Projects are not anymore visible to everybody by default
Diffstat (limited to 'app/Model/User.php')
| -rw-r--r-- | app/Model/User.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/Model/User.php b/app/Model/User.php index b54f6309..33bd6720 100644 --- a/app/Model/User.php +++ b/app/Model/User.php @@ -29,6 +29,24 @@ class User extends Base const EVERYBODY_ID = -1; /** + * Return true is the given user id is administrator + * + * @access public + * @param integer $user_id User id + * @return boolean + */ + public function isAdmin($user_id) + { + $result = $this->db + ->table(User::TABLE) + ->eq('id', $user_id) + ->eq('is_admin', 1) + ->count(); + + return $result > 0; + } + + /** * Get the default project from the session * * @access public |
