Remove feature "Allow everybody to access to this project"
This commit is contained in:
parent
0b9c3b0a5b
commit
cc6618901b
12
ChangeLog
12
ChangeLog
|
|
@ -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)
|
||||
---------------------------------
|
||||
|
||||
|
|
|
|||
6
Makefile
6
Makefile
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -59,25 +59,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
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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' => '',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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' => 'Δημιουργήστε ένα σχόλιο από έναν εξωτερικό πάροχο',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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' => '',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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' => '',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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' => '外部サービスからコメントを作成する',
|
||||
|
|
|
|||
|
|
@ -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' => '외부 서비스로부터 의견을 작성한다',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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' => 'Создать комментарий из внешнего источника',
|
||||
|
|
|
|||
|
|
@ -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' => '',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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' => 'สร้างความคิดเห็นจากบริการภายนอก',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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' => '从外部创建一个评论',
|
||||
|
|
|
|||
|
|
@ -111,22 +111,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
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
)) ?>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,4 @@ Přiřazení rolí je viditelné v **Nastavení projektu > Oprávnění**:
|
|||
|
||||

|
||||
|
||||
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í.
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,4 @@ Role assignments are visible in **Project Settings > Permissions**:
|
|||
|
||||

|
||||
|
||||
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.
|
||||
|
|
|
|||
|
|
@ -15,8 +15,4 @@ L'assignation des rôles est disponible depuis **Paramètres du projet > Permiss
|
|||
|
||||

|
||||
|
||||
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.
|
||||
|
|
|
|||
|
|
@ -37,9 +37,6 @@
|
|||
|
||||
|
||||
|
||||
Если вы выберите **Разрешить любому**, то все пользователи Канборд будут считаться участниками Проекта. В таком случае, нет необходимости назначать роли. Потому что, разрешения, назначенные пользователям и группам, на доступ к Проекту не будут работать.
|
||||
|
||||
|
||||
|
||||
Приватный проект не позволяет устанавливать разрешения.
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,4 @@ Rol atamaları ** Proje Ayarları> İzinler ** 'den ulaşılabilir:
|
|||
|
||||

|
||||
|
||||
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.
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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)));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue