diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-10-27 16:16:11 -0700 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-10-27 16:16:11 -0700 |
commit | cc6618901bc927558dc159ac0dbec1159231c5f1 (patch) | |
tree | f1c14931ab88c0056e538e6d62cd1fa667d94a0d | |
parent | 0b9c3b0a5b61a61faf9061e040e072e4b198f6d2 (diff) |
Remove feature "Allow everybody to access to this project"
47 files changed, 53 insertions, 320 deletions
@@ -1,3 +1,15 @@ +Version 1.x (unreleased) +------------------------ + +Breaking changes: + +* Remove feature "Allow everybody to access to this project" (You must define members and groups) +* Composer dependencies are now included in the repository (except development dependencies) + +Improvements: + +* You can get an archive of Kanboard by using the download button in Github or the command git archive + Version 1.0.48 (October 23, 2017) --------------------------------- @@ -32,21 +32,21 @@ test-browser: @ ./vendor/bin/phpunit -c tests/acceptance.xml integration-test-mysql: - @ composer install + @ composer install --dev @ docker-compose -f tests/docker/compose.integration.mysql.yaml build @ docker-compose -f tests/docker/compose.integration.mysql.yaml up -d mysql app @ docker-compose -f tests/docker/compose.integration.mysql.yaml up tests @ docker-compose -f tests/docker/compose.integration.mysql.yaml down integration-test-postgres: - @ composer install + @ composer install --dev @ docker-compose -f tests/docker/compose.integration.postgres.yaml build @ docker-compose -f tests/docker/compose.integration.postgres.yaml up -d postgres app @ docker-compose -f tests/docker/compose.integration.postgres.yaml up tests @ docker-compose -f tests/docker/compose.integration.postgres.yaml down integration-test-sqlite: - @ composer install + @ composer install --dev @ docker-compose -f tests/docker/compose.integration.sqlite.yaml build @ docker-compose -f tests/docker/compose.integration.sqlite.yaml up -d app @ docker-compose -f tests/docker/compose.integration.sqlite.yaml up tests diff --git a/app/Controller/ProjectPermissionController.php b/app/Controller/ProjectPermissionController.php index 56777b25..d043d3ec 100644 --- a/app/Controller/ProjectPermissionController.php +++ b/app/Controller/ProjectPermissionController.php @@ -60,25 +60,6 @@ class ProjectPermissionController extends BaseController } /** - * Allow everybody - * - * @access public - */ - public function allowEverybody() - { - $project = $this->getProject(); - $values = $this->request->getValues() + array('is_everybody_allowed' => 0); - - if ($this->projectModel->update($values)) { - $this->flash->success(t('Project updated successfully.')); - } else { - $this->flash->failure(t('Unable to update this project.')); - } - - $this->response->redirect($this->helper->url->to('ProjectPermissionController', 'index', array('project_id' => $project['id']))); - } - - /** * Add user to the project * * @access public diff --git a/app/Locale/bs_BA/translations.php b/app/Locale/bs_BA/translations.php index 4c5461e6..b576af09 100644 --- a/app/Locale/bs_BA/translations.php +++ b/app/Locale/bs_BA/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Spisak aktivnosti', 'Dashboard' => 'Panel', 'Confirmation' => 'Potvrda', - 'Allow everybody to access to this project' => 'Dozvoli svima pristup ovom projektu', - 'Everybody have access to this project.' => 'Svima je dozvoljen pristup ovom projektu.', 'Webhooks' => 'Webhooks', 'API' => 'API', 'Create a comment from an external provider' => 'Napravi komentar preko vanjskog posrednika', diff --git a/app/Locale/ca_ES/translations.php b/app/Locale/ca_ES/translations.php index b109b894..bb8dc50b 100644 --- a/app/Locale/ca_ES/translations.php +++ b/app/Locale/ca_ES/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Fluxe d\'activitat', 'Dashboard' => 'Panell', 'Confirmation' => 'Confirmació', - 'Allow everybody to access to this project' => 'Deixa que tothom per accedir a aquest projecte', - 'Everybody have access to this project.' => 'Tothom té accés a aquest projecte.', 'Webhooks' => 'WebHooks', 'API' => 'API', 'Create a comment from an external provider' => 'Crear un comentari d\'un proveïdor extern', diff --git a/app/Locale/cs_CZ/translations.php b/app/Locale/cs_CZ/translations.php index bef1a201..2e729175 100644 --- a/app/Locale/cs_CZ/translations.php +++ b/app/Locale/cs_CZ/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Přehled aktivit', 'Dashboard' => 'Nástěnka', 'Confirmation' => 'Potvrzení', - 'Allow everybody to access to this project' => 'Umožní přístup komukoliv k tomuto projektu', - 'Everybody have access to this project.' => 'Přístup k tomuto projektu má kdokoliv.', 'Webhooks' => 'Webhooks', 'API' => 'API', 'Create a comment from an external provider' => 'Vytvořit komentář pomocí externího poskytovatele', diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php index cc2ffc01..112be172 100644 --- a/app/Locale/da_DK/translations.php +++ b/app/Locale/da_DK/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Aktivitets strøm', 'Dashboard' => 'Dashboard', 'Confirmation' => 'Bekræftelse', - 'Allow everybody to access to this project' => 'Tillad adgang for alle til dette projekt', - 'Everybody have access to this project.' => 'Alle har adgang til dette projekt', // 'Webhooks' => '', // 'API' => '', // 'Create a comment from an external provider' => '', diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php index 964e05d2..b06b3721 100644 --- a/app/Locale/de_DE/translations.php +++ b/app/Locale/de_DE/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Letzte Aktivitäten', 'Dashboard' => 'Dashboard', 'Confirmation' => 'Wiederholung', - 'Allow everybody to access to this project' => 'Jedem Zugriff zu diesem Projekt gewähren', - 'Everybody have access to this project.' => 'Jeder hat Zugriff zu diesem Projekt', 'Webhooks' => 'Webhooks', 'API' => 'API', 'Create a comment from an external provider' => 'Kommentar eines externen Providers hinzufügen', diff --git a/app/Locale/el_GR/translations.php b/app/Locale/el_GR/translations.php index 0e9bea51..9fb2a41e 100644 --- a/app/Locale/el_GR/translations.php +++ b/app/Locale/el_GR/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Ροή δραστηριότητας', 'Dashboard' => 'Κεντρικό ταμπλό', 'Confirmation' => 'Επιβεβαίωση', - 'Allow everybody to access to this project' => 'Να επιτρέπετε σε όλους να έχουν πρόσβαση σε αυτό το έργο', - 'Everybody have access to this project.' => 'Όλοι έχουν πρόσβαση σε αυτό το έργο.', 'Webhooks' => 'Webhooks', 'API' => 'API', 'Create a comment from an external provider' => 'Δημιουργήστε ένα σχόλιο από έναν εξωτερικό πάροχο', diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php index b3ef338d..0490e466 100644 --- a/app/Locale/es_ES/translations.php +++ b/app/Locale/es_ES/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Flujo de actividad', 'Dashboard' => 'Tablero', 'Confirmation' => 'Confirmación', - 'Allow everybody to access to this project' => 'Permitir a cualquier acceder a este proyecto', - 'Everybody have access to this project.' => 'Cualquier tiene acceso a este proyecto', 'Webhooks' => 'Webhooks', 'API' => 'API', 'Create a comment from an external provider' => 'Crear un comentario a partir de un proveedor externo', diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php index 9607a8f7..27ff0eed 100644 --- a/app/Locale/fi_FI/translations.php +++ b/app/Locale/fi_FI/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Toiminta', 'Dashboard' => 'Työpöytä', 'Confirmation' => 'Vahvistus', - 'Allow everybody to access to this project' => 'Anna kaikille käyttöoikeus tähän projektiin', - 'Everybody have access to this project.' => 'Kaikilla on käyttöoikeus projektiin.', // 'Webhooks' => '', // 'API' => '', // 'Create a comment from an external provider' => '', diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php index 12161219..830cb5c3 100644 --- a/app/Locale/fr_FR/translations.php +++ b/app/Locale/fr_FR/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Flux d\'activité', 'Dashboard' => 'Tableau de bord', 'Confirmation' => 'Confirmation', - 'Allow everybody to access to this project' => 'Autoriser tout le monde à accéder à ce projet', - 'Everybody have access to this project.' => 'Tout le monde a accès à ce projet.', 'Webhooks' => 'Webhooks', 'API' => 'API', 'Create a comment from an external provider' => 'Créer un commentaire depuis un fournisseur externe', diff --git a/app/Locale/hr_HR/translations.php b/app/Locale/hr_HR/translations.php index 5647603a..2eeb5bb0 100644 --- a/app/Locale/hr_HR/translations.php +++ b/app/Locale/hr_HR/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Popis aktivnosti', 'Dashboard' => 'Nadzorna ploča', 'Confirmation' => 'Potvrda', - 'Allow everybody to access to this project' => 'Dozvoli svima pristup projektu', - 'Everybody have access to this project.' => 'Svima je dozvoljen pristup.', // 'Webhooks' => '', // 'API' => '', // 'Create a comment from an external provider' => '', diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php index ac33e389..c19a9b5a 100644 --- a/app/Locale/hu_HU/translations.php +++ b/app/Locale/hu_HU/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Legutóbbi tevékenységek', 'Dashboard' => 'Vezérlőpult', 'Confirmation' => 'Megerősítés', - 'Allow everybody to access to this project' => 'A projekt elérése mindenkinek engedélyezett', - 'Everybody have access to this project.' => 'Mindenki elérheti a projektet', 'Webhooks' => 'Webhook', 'API' => 'API', 'Create a comment from an external provider' => 'Megjegyzés létrehozása külső felhasználótól', diff --git a/app/Locale/id_ID/translations.php b/app/Locale/id_ID/translations.php index 62e6ca04..4f922752 100644 --- a/app/Locale/id_ID/translations.php +++ b/app/Locale/id_ID/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Arus aktifitas', 'Dashboard' => 'Dasbor', 'Confirmation' => 'Konfirmasi', - 'Allow everybody to access to this project' => 'Izinkan semua orang untuk mengakses proyek ini', - 'Everybody have access to this project.' => 'Semua orang mendapat akses untuk proyek ini.', 'Webhooks' => 'Webhooks', 'API' => 'API', 'Create a comment from an external provider' => 'Buat komentar dari penyedia eksternal', diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php index 9f045d8e..1c2b7144 100644 --- a/app/Locale/it_IT/translations.php +++ b/app/Locale/it_IT/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Flusso attività', 'Dashboard' => 'Bacheca', 'Confirmation' => 'Conferma', - 'Allow everybody to access to this project' => 'Abilita tutti ad accedere a questo progetto', - 'Everybody have access to this project.' => 'Tutti hanno accesso a questo progetto.', // 'Webhooks' => '', // 'API' => '', 'Create a comment from an external provider' => 'Crea un commit da un provider esterno', diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php index f25f25fa..a78b69dd 100644 --- a/app/Locale/ja_JP/translations.php +++ b/app/Locale/ja_JP/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'アクティビティストリーム', 'Dashboard' => 'ダッシュボード', 'Confirmation' => '確認', - 'Allow everybody to access to this project' => '全員にプロジェクトへのアクセスを許す', - 'Everybody have access to this project.' => '誰でもこのプロジェクトにアクセスできます', 'Webhooks' => 'Webhook', 'API' => 'API', 'Create a comment from an external provider' => '外部サービスからコメントを作成する', diff --git a/app/Locale/ko_KR/translations.php b/app/Locale/ko_KR/translations.php index d1aec37c..fa75667e 100644 --- a/app/Locale/ko_KR/translations.php +++ b/app/Locale/ko_KR/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => '활동기록', 'Dashboard' => '대시보드', 'Confirmation' => '확인', - 'Allow everybody to access to this project' => '모든 사람이 이 프로젝트에 접근할 수 있도록 합니다', - 'Everybody have access to this project.' => '누구나 이 프로젝트에 액세스 할 수 있습니다', 'Webhooks' => 'Webhook', 'API' => 'API', 'Create a comment from an external provider' => '외부 서비스로부터 의견을 작성한다', diff --git a/app/Locale/my_MY/translations.php b/app/Locale/my_MY/translations.php index 962943e2..62aeecad 100644 --- a/app/Locale/my_MY/translations.php +++ b/app/Locale/my_MY/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Arus aktifitas', 'Dashboard' => 'Dasbor', 'Confirmation' => 'Konfirmasi', - 'Allow everybody to access to this project' => 'Memungkinkan semua orang untuk mengakses projek ini', - 'Everybody have access to this project.' => 'Semua orang mendapat akses untuk projek ini.', 'Webhooks' => 'Webhooks', 'API' => 'API', 'Create a comment from an external provider' => 'Buat komentar dari pemasok eksternal', diff --git a/app/Locale/nb_NO/translations.php b/app/Locale/nb_NO/translations.php index 9802daf1..3445cb5f 100644 --- a/app/Locale/nb_NO/translations.php +++ b/app/Locale/nb_NO/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Aktivitetslogg', 'Dashboard' => 'Hovedsiden', 'Confirmation' => 'Bekreftelse', - 'Allow everybody to access to this project' => 'Gi alle tilgang til dette prosjektet', - 'Everybody have access to this project.' => 'Alle har tilgang til dette prosjektet', // 'Webhooks' => '', // 'API' => '', 'Create a comment from an external provider' => 'Opprett en kommentar fra en ekstern tilbyder', diff --git a/app/Locale/nl_NL/translations.php b/app/Locale/nl_NL/translations.php index 485a041d..0a3706c8 100644 --- a/app/Locale/nl_NL/translations.php +++ b/app/Locale/nl_NL/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Activiteiten', 'Dashboard' => 'Dashboard', // 'Confirmation' => '', - 'Allow everybody to access to this project' => 'Geef iedereen toegang tot dit project', - 'Everybody have access to this project.' => 'Iedereen heeft toegang tot dit project.', 'Webhooks' => 'Webhooks', 'API' => 'API', 'Create a comment from an external provider' => 'Voeg een commentaar toe van een externe provider', diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php index e2a2be6f..58bcbb46 100644 --- a/app/Locale/pl_PL/translations.php +++ b/app/Locale/pl_PL/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Strumień aktywności', 'Dashboard' => 'Dashboard', 'Confirmation' => 'Potwierdzenie', - 'Allow everybody to access to this project' => 'Udostępnij ten projekt wszystkim', - 'Everybody have access to this project.' => 'Wszyscy mają dostęp do tego projektu.', 'Webhooks' => 'Webhooki', // 'API' => '', 'Create a comment from an external provider' => 'Utwórz komentarz od zewnętrznego dostawcy', diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php index 74cbed04..20a2f983 100644 --- a/app/Locale/pt_BR/translations.php +++ b/app/Locale/pt_BR/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Atividades Recentes', 'Dashboard' => 'Painel de Controle', 'Confirmation' => 'Confirmação', - 'Allow everybody to access to this project' => 'Permitir que todos acessem este projeto', - 'Everybody have access to this project.' => 'Todos possuem acesso a este projeto.', 'Webhooks' => 'Webhooks', 'API' => 'API', 'Create a comment from an external provider' => 'Criar um comentário por meio de um serviço externo', diff --git a/app/Locale/pt_PT/translations.php b/app/Locale/pt_PT/translations.php index 7448be5b..9d5d5efe 100644 --- a/app/Locale/pt_PT/translations.php +++ b/app/Locale/pt_PT/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Atividades Recentes', 'Dashboard' => 'Painel de Controlo', 'Confirmation' => 'Confirmação', - 'Allow everybody to access to this project' => 'Permitir a todos os acesso a este projeto', - 'Everybody have access to this project.' => 'Todos possuem acesso a este projeto.', 'Webhooks' => 'Webhooks', 'API' => 'API', 'Create a comment from an external provider' => 'Criar um comentário por meio de um serviço externo', diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php index 9718b976..3e7d8a02 100644 --- a/app/Locale/ru_RU/translations.php +++ b/app/Locale/ru_RU/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Текущая активность', 'Dashboard' => 'Панель управления', 'Confirmation' => 'Подтверждение пароля', - 'Allow everybody to access to this project' => 'Разрешить любому', - 'Everybody have access to this project.' => 'Любой может получить доступ к этому проекту.', 'Webhooks' => 'Webhooks', 'API' => 'API', 'Create a comment from an external provider' => 'Создать комментарий из внешнего источника', diff --git a/app/Locale/sr_Latn_RS/translations.php b/app/Locale/sr_Latn_RS/translations.php index f9c2e5f4..0173b8fd 100644 --- a/app/Locale/sr_Latn_RS/translations.php +++ b/app/Locale/sr_Latn_RS/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Spisak aktinosti', 'Dashboard' => 'Panel', 'Confirmation' => 'Potvrda', - 'Allow everybody to access to this project' => 'Dozvoli svima pristup projektu', - 'Everybody have access to this project.' => 'Svima je dozvoljen pristup.', // 'Webhooks' => '', // 'API' => '', // 'Create a comment from an external provider' => '', diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php index 11c45345..8522072f 100644 --- a/app/Locale/sv_SE/translations.php +++ b/app/Locale/sv_SE/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Aktivitetsström', 'Dashboard' => 'Instrumentpanel', 'Confirmation' => 'Bekräftelse', - 'Allow everybody to access to this project' => 'Ge alla tillgång till projektet', - 'Everybody have access to this project.' => 'Alla har tillgång till projektet', 'Webhooks' => 'Webhooks', 'API' => 'API', 'Create a comment from an external provider' => 'Skapa en kommentar från en extern leverantör', diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php index a092657c..1cf74352 100644 --- a/app/Locale/th_TH/translations.php +++ b/app/Locale/th_TH/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'กิจกรรมที่เกิดขึ้น', 'Dashboard' => 'แดชบอร์ด', 'Confirmation' => 'ยืนยันรหัสผ่าน', - 'Allow everybody to access to this project' => 'อนุญาตให้ทุกคนเข้าถึงโปรเจคนี้', - 'Everybody have access to this project.' => 'ทุกคนสามารถเข้าถึงโปรเจคนี้', // 'Webhooks' => '', // 'API' => '', 'Create a comment from an external provider' => 'สร้างความคิดเห็นจากบริการภายนอก', diff --git a/app/Locale/tr_TR/translations.php b/app/Locale/tr_TR/translations.php index fb44d346..e049d286 100644 --- a/app/Locale/tr_TR/translations.php +++ b/app/Locale/tr_TR/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Güncel olay akışı', 'Dashboard' => 'Pano', 'Confirmation' => 'Onay', - 'Allow everybody to access to this project' => 'Bu projeye herkesin erişimine izin ver', - 'Everybody have access to this project.' => 'Bu projeye herkesin erişimi var.', 'Webhooks' => 'Web Kancaları', 'API' => 'API', 'Create a comment from an external provider' => 'Dış sağlayıcı ile bir yorum oluştur', diff --git a/app/Locale/vi_VN/translations.php b/app/Locale/vi_VN/translations.php index cd3d6aea..35984b9b 100644 --- a/app/Locale/vi_VN/translations.php +++ b/app/Locale/vi_VN/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => 'Luồng hoạt động', 'Dashboard' => 'Bảng điều khiển', 'Confirmation' => 'Xác nhận', - 'Allow everybody to access to this project' => 'Cho phép mọi người truy cập vào dự án này', - 'Everybody have access to this project.' => 'Mọi người đều có quyền truy cập vào dự án này.', 'Webhooks' => 'Webhooks', 'API' => 'API', 'Create a comment from an external provider' => 'Tạo một bình luận từ một nhà cung cấp bên ngoài', diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php index 6e4523b1..8d51fa9f 100644 --- a/app/Locale/zh_CN/translations.php +++ b/app/Locale/zh_CN/translations.php @@ -394,8 +394,6 @@ return array( 'Activity stream' => '动态记录', 'Dashboard' => '面板', 'Confirmation' => '确认', - 'Allow everybody to access to this project' => '允许所有人访问此项目', - 'Everybody have access to this project.' => '所有人都可以访问此项目', 'Webhooks' => '网络钩子', 'API' => '应用程序接口', 'Create a comment from an external provider' => '从外部创建一个评论', diff --git a/app/Model/ProjectPermissionModel.php b/app/Model/ProjectPermissionModel.php index 752913d7..d1351a6c 100644 --- a/app/Model/ProjectPermissionModel.php +++ b/app/Model/ProjectPermissionModel.php @@ -112,22 +112,6 @@ class ProjectPermissionModel extends Base } /** - * Return true if everybody is allowed for the project - * - * @access public - * @param integer $project_id Project id - * @return bool - */ - public function isEverybodyAllowed($project_id) - { - return $this->db - ->table(ProjectModel::TABLE) - ->eq('id', $project_id) - ->eq('is_everybody_allowed', 1) - ->exists(); - } - - /** * Return true if the user is allowed to access a project * * @param integer $project_id diff --git a/app/Model/ProjectUserRoleModel.php b/app/Model/ProjectUserRoleModel.php index a95cf5d9..dc4add34 100644 --- a/app/Model/ProjectUserRoleModel.php +++ b/app/Model/ProjectUserRoleModel.php @@ -44,10 +44,7 @@ class ProjectUserRoleModel extends Base { $userProjects = $this->db ->hashtable(ProjectModel::TABLE) - ->beginOr() ->eq(self::TABLE.'.user_id', $user_id) - ->eq(ProjectModel::TABLE.'.is_everybody_allowed', 1) - ->closeOr() ->in(ProjectModel::TABLE.'.is_active', $status) ->join(self::TABLE, 'project_id', 'id') ->getAll(ProjectModel::TABLE.'.id', ProjectModel::TABLE.'.name'); @@ -70,15 +67,6 @@ class ProjectUserRoleModel extends Base */ public function getUserRole($project_id, $user_id) { - $projectInfo = $this->db->table(ProjectModel::TABLE) - ->eq('id', $project_id) - ->columns('owner_id', 'is_everybody_allowed') - ->findOne(); - - if ($projectInfo['is_everybody_allowed'] == 1) { - return $projectInfo['owner_id'] == $user_id ? Role::PROJECT_MANAGER : Role::PROJECT_MEMBER; - } - $role = $this->db->table(self::TABLE)->eq('user_id', $user_id)->eq('project_id', $project_id)->findOneColumn('role'); if (empty($role)) { @@ -163,10 +151,6 @@ class ProjectUserRoleModel extends Base */ public function getAssignableUsers($project_id) { - if ($this->projectPermissionModel->isEverybodyAllowed($project_id)) { - return $this->userModel->getActiveUsersList(); - } - $userMembers = $this->db->table(self::TABLE) ->columns(UserModel::TABLE.'.id', UserModel::TABLE.'.username', UserModel::TABLE.'.name') ->join(UserModel::TABLE, 'id', 'user_id') diff --git a/app/Model/UserNotificationModel.php b/app/Model/UserNotificationModel.php index d77526f6..9e90cf5d 100644 --- a/app/Model/UserNotificationModel.php +++ b/app/Model/UserNotificationModel.php @@ -68,10 +68,6 @@ class UserNotificationModel extends Base */ public function getUsersWithNotificationEnabled($project_id, $exclude_user_id = 0) { - if ($this->projectPermissionModel->isEverybodyAllowed($project_id)) { - return $this->getEverybodyWithNotificationEnabled($exclude_user_id); - } - $users = array(); $members = $this->getProjectUserMembersWithNotificationEnabled($project_id, $exclude_user_id); $groups = $this->getProjectGroupMembersWithNotificationEnabled($project_id, $exclude_user_id); @@ -183,22 +179,4 @@ class UserNotificationModel extends Base ->eq(UserModel::TABLE.'.is_active', 1) ->findAll(); } - - /** - * Get a list of project members with notification enabled - * - * @access private - * @param integer $exclude_user_id User id to exclude - * @return array - */ - private function getEverybodyWithNotificationEnabled($exclude_user_id) - { - return $this->db - ->table(UserModel::TABLE) - ->columns(UserModel::TABLE.'.id', UserModel::TABLE.'.username', UserModel::TABLE.'.name', UserModel::TABLE.'.email', UserModel::TABLE.'.language', UserModel::TABLE.'.notifications_filter') - ->eq('notifications_enabled', '1') - ->neq(UserModel::TABLE.'.id', $exclude_user_id) - ->eq(UserModel::TABLE.'.is_active', 1) - ->findAll(); - } } diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 20ef0080..ca284f47 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -8,7 +8,12 @@ use PDO; use Kanboard\Core\Security\Token; use Kanboard\Core\Security\Role; -const VERSION = 124; +const VERSION = 125; + +function version_125(PDO $pdo) +{ + $pdo->exec('ALTER TABLE projects DROP COLUMN is_everybody_allowed'); +} function version_124(PDO $pdo) { diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php index a5b52b2b..312b1dba 100644 --- a/app/Schema/Postgres.php +++ b/app/Schema/Postgres.php @@ -8,7 +8,12 @@ use PDO; use Kanboard\Core\Security\Token; use Kanboard\Core\Security\Role; -const VERSION = 103; +const VERSION = 104; + +function version_104(PDO $pdo) +{ + $pdo->exec('ALTER TABLE projects DROP COLUMN is_everybody_allowed'); +} function version_103(PDO $pdo) { diff --git a/app/Template/project_permission/index.php b/app/Template/project_permission/index.php index 689966b6..52a69fb5 100644 --- a/app/Template/project_permission/index.php +++ b/app/Template/project_permission/index.php @@ -2,36 +2,18 @@ <h2><?= t('Allowed Users') ?></h2> </div> -<?php if ($project['is_everybody_allowed']): ?> - <div class="alert"><?= t('Everybody have access to this project.') ?></div> -<?php else: ?> - <?= $this->render('project_permission/users', array( - 'project' => $project, - 'roles' => $roles, - 'users' => $users, - 'errors' => $errors, - 'values' => $values, - )) ?> +<?= $this->render('project_permission/users', array( + 'project' => $project, + 'roles' => $roles, + 'users' => $users, + 'errors' => $errors, + 'values' => $values, +)) ?> - <?= $this->render('project_permission/groups', array( - 'project' => $project, - 'roles' => $roles, - 'groups' => $groups, - 'errors' => $errors, - 'values' => $values, - )) ?> -<?php endif ?> - -<?php if ($project['is_private'] == 0): ?> -<hr/> -<form method="post" action="<?= $this->url->href('ProjectPermissionController', 'allowEverybody', array('project_id' => $project['id'])) ?>"> - <?= $this->form->csrf() ?> - - <?= $this->form->hidden('id', array('id' => $project['id'])) ?> - <?= $this->form->checkbox('is_everybody_allowed', t('Allow everybody to access to this project'), 1, $project['is_everybody_allowed']) ?> - - <div class="form-actions"> - <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> - </div> -</form> -<?php endif ?> +<?= $this->render('project_permission/groups', array( + 'project' => $project, + 'roles' => $roles, + 'groups' => $groups, + 'errors' => $errors, + 'values' => $values, +)) ?> diff --git a/doc/cs_CZ/project-permissions.markdown b/doc/cs_CZ/project-permissions.markdown index 9d8ca86f..6ced801b 100644 --- a/doc/cs_CZ/project-permissions.markdown +++ b/doc/cs_CZ/project-permissions.markdown @@ -17,7 +17,4 @@ Přiřazení rolí je viditelné v **Nastavení projektu > Oprávnění**: ![Oprávnění projektu](screenshots/project-permissions.png) -Pokud se rozhodnete povolit přístup všem, budou všichni uživatelé Kanboard považováni za členy projektu. -Tímto nastavením nebude mít správa rolí žádný vliv. Oprávnění na uživatele nebo skupinu nelze použít. - U soukromých projektů nelze definovat oprávnění.
\ No newline at end of file diff --git a/doc/en_US/api-me-procedures.markdown b/doc/en_US/api-me-procedures.markdown index e90bee61..c2476904 100644 --- a/doc/en_US/api-me-procedures.markdown +++ b/doc/en_US/api-me-procedures.markdown @@ -78,7 +78,6 @@ Response example: "last_modified": "1438205337", "is_public": "0", "is_private": "1", - "is_everybody_allowed": "0", "default_swimlane": "Default swimlane", "show_default_swimlane": "1", "description": null, @@ -369,7 +368,6 @@ Response example: "last_modified": "1436119570", "is_public": "0", "is_private": "0", - "is_everybody_allowed": "0", "default_swimlane": "Default swimlane", "show_default_swimlane": "1", "description": null, diff --git a/doc/en_US/api-project-procedures.markdown b/doc/en_US/api-project-procedures.markdown index 831c4b60..91793803 100644 --- a/doc/en_US/api-project-procedures.markdown +++ b/doc/en_US/api-project-procedures.markdown @@ -70,7 +70,6 @@ Response example: "last_modified": "1436119135", "is_public": "0", "is_private": "0", - "is_everybody_allowed": "0", "default_swimlane": "Default swimlane", "show_default_swimlane": "1", "description": "test", @@ -119,7 +118,6 @@ Response example: "last_modified": "1436119135", "is_public": "0", "is_private": "0", - "is_everybody_allowed": "0", "default_swimlane": "Default swimlane", "show_default_swimlane": "1", "description": "test", @@ -168,7 +166,6 @@ Response example: "last_modified": "1436119135", "is_public": "0", "is_private": "0", - "is_everybody_allowed": "0", "default_swimlane": "Default swimlane", "show_default_swimlane": "1", "description": "test", @@ -217,7 +214,6 @@ Response example: "last_modified": "1436119135", "is_public": "0", "is_private": "0", - "is_everybody_allowed": "0", "default_swimlane": "Default swimlane", "show_default_swimlane": "1", "description": "test", @@ -265,7 +261,6 @@ Response example: "last_modified": "1436119570", "is_public": "0", "is_private": "0", - "is_everybody_allowed": "0", "default_swimlane": "Default swimlane", "show_default_swimlane": "1", "description": null, diff --git a/doc/en_US/project-permissions.markdown b/doc/en_US/project-permissions.markdown index 99e4caa2..05c81ef9 100644 --- a/doc/en_US/project-permissions.markdown +++ b/doc/en_US/project-permissions.markdown @@ -17,7 +17,4 @@ Role assignments are visible in **Project Settings > Permissions**: ![Project Permissions](screenshots/project-permissions.png) -If you choose to allow everybody, all Kanboard users will be considered 'Project Member'. -With this setting, role management will have no effect. Permission per user or per group cannot be applied. - Private projects cannot define permissions. diff --git a/doc/fr_FR/project-permissions.markdown b/doc/fr_FR/project-permissions.markdown index c4ef4df4..d5e3662d 100644 --- a/doc/fr_FR/project-permissions.markdown +++ b/doc/fr_FR/project-permissions.markdown @@ -15,8 +15,4 @@ L'assignation des rôles est disponible depuis **Paramètres du projet > Permiss ![Permissions du projet](screenshots/project-permissions.png) -Si vous choisissez d'autoriser tout le monde, tous les utilisateurs de Kanboard seront considérés comme **Membre du projet**. -Ce qui signifie qu'il n'y a plus des gestion de rôles. -Les permissions par utilisateur ou par groupe ne peuvent plus être appliquées. - Les projets privés ne peuvent pas définir de permissions. diff --git a/doc/ru_RU/project-permissions.markdown b/doc/ru_RU/project-permissions.markdown index 6859c1a8..0235c9f6 100644 --- a/doc/ru_RU/project-permissions.markdown +++ b/doc/ru_RU/project-permissions.markdown @@ -37,9 +37,6 @@ -Если вы выберите **Разрешить любому**, то все пользователи Канборд будут считаться участниками Проекта. В таком случае, нет необходимости назначать роли. Потому что, разрешения, назначенные пользователям и группам, на доступ к Проекту не будут работать. - - Приватный проект не позволяет устанавливать разрешения. diff --git a/doc/tr_TR/project-permissions.markdown b/doc/tr_TR/project-permissions.markdown index 2440f085..19eebe51 100644 --- a/doc/tr_TR/project-permissions.markdown +++ b/doc/tr_TR/project-permissions.markdown @@ -17,7 +17,4 @@ Rol atamaları ** Proje Ayarları> İzinler ** 'den ulaşılabilir: ![Project Permissions](screenshots/project-permissions.png) -Herkese izin vermeyi seçerseniz, tüm Kanboard kullanıcıları Proje Üyesi olarak değerlendirilecektir. -Bu da artık rol yönetimi olmadığını gösterir. Kullanıcı veya grup başına izin kullanılamaz. - Özel projeler izin tanımlayamaz. diff --git a/tests/units/Model/ProjectPermissionModelTest.php b/tests/units/Model/ProjectPermissionModelTest.php index 7f604374..4b5a7476 100644 --- a/tests/units/Model/ProjectPermissionModelTest.php +++ b/tests/units/Model/ProjectPermissionModelTest.php @@ -120,18 +120,6 @@ class ProjectPermissionModelTest extends Base $this->assertEquals('Project 3', $users[0]['project_name']); } - public function testEverybodyAllowed() - { - $projectModel = new ProjectModel($this->container); - $projectPermission = new ProjectPermissionModel($this->container); - - $this->assertEquals(1, $projectModel->create(array('name' => 'Project 1'))); - $this->assertEquals(2, $projectModel->create(array('name' => 'Project 2', 'is_everybody_allowed' => 1))); - - $this->assertFalse($projectPermission->isEverybodyAllowed(1)); - $this->assertTrue($projectPermission->isEverybodyAllowed(2)); - } - public function testIsUserAllowed() { $userModel = new UserModel($this->container); diff --git a/tests/units/Model/ProjectUserRoleTest.php b/tests/units/Model/ProjectUserRoleTest.php index d59b15c9..e45080eb 100644 --- a/tests/units/Model/ProjectUserRoleTest.php +++ b/tests/units/Model/ProjectUserRoleTest.php @@ -101,26 +101,6 @@ class ProjectUserRoleTest extends Base $this->assertEquals('', $userRoleModel->getUserRole(1, 2)); } - public function testGetRoleWithPublicProject() - { - $projectModel = new ProjectModel($this->container); - $userRoleModel = new ProjectUserRoleModel($this->container); - $userModel = new UserModel($this->container); - - $this->assertEquals(2, $userModel->create(array('username' => 'user1', 'name' => 'User1'))); - $this->assertEquals(3, $userModel->create(array('username' => 'user2', 'name' => 'User2'))); - - $this->assertEquals(1, $projectModel->create(array('name' => 'Test'), 2, true)); - - $this->assertEquals(Role::PROJECT_MANAGER, $userRoleModel->getUserRole(1, 2)); - $this->assertEquals(null, $userRoleModel->getUserRole(1, 3)); - - $this->assertTrue($projectModel->update(array('id' => 1, 'is_everybody_allowed' => 1))); - - $this->assertEquals(Role::PROJECT_MANAGER, $userRoleModel->getUserRole(1, 2)); - $this->assertEquals(Role::PROJECT_MEMBER, $userRoleModel->getUserRole(1, 3)); - } - public function testGetAssignableUsersWithDisabledUsers() { $projectModel = new ProjectModel($this->container); @@ -247,59 +227,6 @@ class ProjectUserRoleTest extends Base $this->assertEquals('admin', $users[1]); } - public function testGetAssignableUsersWithEverybodyAllowed() - { - $projectModel = new ProjectModel($this->container); - $userModel = new UserModel($this->container); - $userRoleModel = new ProjectUserRoleModel($this->container); - - $this->assertEquals(1, $projectModel->create(array('name' => 'Test', 'is_everybody_allowed' => 1))); - - $this->assertEquals(2, $userModel->create(array('username' => 'user1', 'name' => 'User1'))); - $this->assertEquals(3, $userModel->create(array('username' => 'user2', 'name' => 'User2'))); - $this->assertEquals(4, $userModel->create(array('username' => 'user3', 'name' => 'User3'))); - $this->assertEquals(5, $userModel->create(array('username' => 'user4', 'name' => 'User4'))); - - $users = $userRoleModel->getAssignableUsers(1); - $this->assertCount(5, $users); - - $this->assertEquals('admin', $users[1]); - $this->assertEquals('User1', $users[2]); - $this->assertEquals('User2', $users[3]); - $this->assertEquals('User3', $users[4]); - $this->assertEquals('User4', $users[5]); - } - - public function testGetAssignableUsersWithDisabledUsersAndEverybodyAllowed() - { - $projectModel = new ProjectModel($this->container); - $projectPermission = new ProjectPermissionModel($this->container); - $userModel = new UserModel($this->container); - $userRoleModel = new ProjectUserRoleModel($this->container); - - $this->assertEquals(2, $userModel->create(array('username' => 'user1', 'name' => 'User1'))); - $this->assertEquals(3, $userModel->create(array('username' => 'user2', 'name' => 'User2'))); - - $this->assertEquals(1, $projectModel->create(array('name' => 'Project 1', 'is_everybody_allowed' => 1))); - - $this->assertTrue($projectPermission->isEverybodyAllowed(1)); - - $users = $userRoleModel->getAssignableUsers(1); - $this->assertCount(3, $users); - - $this->assertEquals('admin', $users[1]); - $this->assertEquals('User1', $users[2]); - $this->assertEquals('User2', $users[3]); - - $this->assertTrue($userModel->disable(2)); - - $users = $userRoleModel->getAssignableUsers(1); - $this->assertCount(2, $users); - - $this->assertEquals('admin', $users[1]); - $this->assertEquals('User2', $users[3]); - } - public function testGetProjectsByUser() { $userModel = new UserModel($this->container); diff --git a/tests/units/Model/UserNotificationTest.php b/tests/units/Model/UserNotificationTest.php index 6ee5c875..e568d204 100644 --- a/tests/units/Model/UserNotificationTest.php +++ b/tests/units/Model/UserNotificationTest.php @@ -179,55 +179,21 @@ class UserNotificationTest extends Base $this->assertEquals('user3@here', $users[2]['email']); } - public function testGetUsersWithNotificationsWhenEverybodyAllowed() - { - $u = new UserModel($this->container); - $p = new ProjectModel($this->container); - $n = new UserNotificationModel($this->container); - $pp = new ProjectPermissionModel($this->container); - - $this->assertEquals(1, $p->create(array('name' => 'UnitTest1', 'is_everybody_allowed' => 1))); - $this->assertTrue($pp->isEverybodyAllowed(1)); - - // Email + Notifications enabled - $this->assertEquals(2, $u->create(array('username' => 'user1', 'email' => 'user1@here', 'notifications_enabled' => 1))); - - // No email + Notifications enabled - $this->assertEquals(3, $u->create(array('username' => 'user2', 'email' => '', 'notifications_enabled' => 1))); - - // Email + Notifications enabled - $this->assertEquals(4, $u->create(array('username' => 'user3', 'email' => 'user3@here', 'notifications_enabled' => 1))); - - // User disabled - $this->assertEquals(5, $u->create(array('username' => 'user4', 'email' => 'user3@here', 'notifications_enabled' => 1, 'is_active' => 0))); - - // No email + notifications disabled - $this->assertEquals(6, $u->create(array('username' => 'user5'))); - - $users = $n->getUsersWithNotificationEnabled(1); - - $this->assertNotEmpty($users); - $this->assertCount(3, $users); - $this->assertEquals('user1@here', $users[0]['email']); - $this->assertEquals('', $users[1]['email']); - $this->assertEquals('user3@here', $users[2]['email']); - } - public function testSendNotifications() { - $u = new UserModel($this->container); - $n = new UserNotificationModel($this->container); - $p = new ProjectModel($this->container); - $tc = new TaskCreationModel($this->container); - $tf = new TaskFinderModel($this->container); - $pp = new ProjectPermissionModel($this->container); + $userModel = new UserModel($this->container); + $userNotificationModel = new UserNotificationModel($this->container); + $projectModel = new ProjectModel($this->container); + $taskCreationModel = new TaskCreationModel($this->container); + $taskFinderModel = new TaskFinderModel($this->container); + $projectUserRoleModel = new ProjectUserRoleModel($this->container); - $this->assertEquals(1, $p->create(array('name' => 'UnitTest1', 'is_everybody_allowed' => 1))); - $this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1))); - $this->assertTrue($u->update(array('id' => 1, 'email' => 'test@localhost'))); - $this->assertTrue($pp->isEverybodyAllowed(1)); + $this->assertEquals(1, $projectModel->create(array('name' => 'UnitTest1'))); + $this->assertEquals(1, $taskCreationModel->create(array('title' => 'test', 'project_id' => 1))); + $this->assertTrue($userModel->update(array('id' => 1, 'email' => 'test@localhost'))); + $this->assertTrue($projectUserRoleModel->addUser(1, 1, Role::PROJECT_MANAGER)); - $n->saveSettings(1, array( + $userNotificationModel->saveSettings(1, array( 'notifications_enabled' => 1, 'notifications_filter' => UserNotificationFilterModel::FILTER_NONE, 'notification_types' => array('web' => 1, 'email' => 1), @@ -259,6 +225,6 @@ class UserNotificationTest extends Base ->with($this->equalTo('web')) ->will($this->returnValue($notifier)); - $n->sendNotifications(TaskModel::EVENT_CREATE, array('task' => $tf->getDetails(1))); + $userNotificationModel->sendNotifications(TaskModel::EVENT_CREATE, array('task' => $taskFinderModel->getDetails(1))); } } |