diff options
author | Frédéric Guillot <contact@fredericguillot.com> | 2014-03-05 19:47:46 -0500 |
---|---|---|
committer | Frédéric Guillot <contact@fredericguillot.com> | 2014-03-05 19:47:46 -0500 |
commit | 5d9b5aee6d70de0c1cbd6abe79a22a6c51719069 (patch) | |
tree | 8c89ad98effb80681882853e728fc4d2c80a396a /models | |
parent | 1d94ba9914751b6acd742e5538263b0f394e9189 (diff) | |
parent | 850abb1500a2785e64c0ac7aa621ec55920439c4 (diff) |
Merge branch 'patch-1' of github.com:toomyem/kanboard
Diffstat (limited to 'models')
-rw-r--r-- | models/project.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/models/project.php b/models/project.php index a2f66478..45cd1baa 100644 --- a/models/project.php +++ b/models/project.php @@ -82,6 +82,15 @@ class Project extends Base if ($nb_users < 1) return true; + // check if user has admin rights + $nb_users = $this->db + ->table(\Model\User::TABLE) + ->eq('id', $user_id) + ->eq('is_admin', 1) + ->count(); + + if ($nb_users > 0) return true; + // Otherwise, allow only specific users return (bool) $this->db ->table(self::TABLE_USERS) |