Compare commits
91 Commits
fix/2749-c
...
stable0.8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
634ae1103c | ||
|
|
69b6fc4d0a | ||
|
|
39a575782b | ||
|
|
ee47a82e62 | ||
|
|
5bd6752bc5 | ||
|
|
37cf13b141 | ||
|
|
1ce0643c6b | ||
|
|
ccc02e23b6 | ||
|
|
d1812b6801 | ||
|
|
6c0da2bea1 | ||
|
|
474dac00ff | ||
|
|
a599ffe992 | ||
|
|
e92f581049 | ||
|
|
07c53f8b4f | ||
|
|
112c809112 | ||
|
|
d8d1df7c74 | ||
|
|
5f75bebe6e | ||
|
|
227833d322 | ||
|
|
cf889e566b | ||
|
|
56a0a605cd | ||
|
|
87e6be6d10 | ||
|
|
3728e4b0d5 | ||
|
|
cfef011f03 | ||
|
|
0a82c0a137 | ||
|
|
b09d3d00b4 | ||
|
|
7c905528e7 | ||
|
|
aeba3787a3 | ||
|
|
033965d1cb | ||
|
|
0b5bc05116 | ||
|
|
2dc8e219f0 | ||
|
|
cd3b201ae8 | ||
|
|
daddeaa109 | ||
|
|
07ad95ee8c | ||
|
|
0882b15825 | ||
|
|
32f2561267 | ||
|
|
d54ee14268 | ||
|
|
013505bd4e | ||
|
|
83631f2888 | ||
|
|
83017ba262 | ||
|
|
0be1f13015 | ||
|
|
764b08e80b | ||
|
|
b8caa922ab | ||
|
|
c4a23ad4ff | ||
|
|
fe538b87a7 | ||
|
|
d178a4501b | ||
|
|
e8a6ef1116 | ||
|
|
2e182b6571 | ||
|
|
23f86231fd | ||
|
|
c6b25a6438 | ||
|
|
b7ce980f44 | ||
|
|
615210dde4 | ||
|
|
245d5a3eaf | ||
|
|
e865776575 | ||
|
|
8f89d34d9f | ||
|
|
c12a5ae879 | ||
|
|
da5ef24085 | ||
|
|
fd88a0b85a | ||
|
|
eca18e43f9 | ||
|
|
a7c302e7e0 | ||
|
|
609eaf6929 | ||
|
|
5130cc931a | ||
|
|
3de68ebfcd | ||
|
|
372935f190 | ||
|
|
fec0658102 | ||
|
|
1411c327cb | ||
|
|
c7c9edf2e3 | ||
|
|
97428b51ff | ||
|
|
52bcd0ec03 | ||
|
|
442d9bdedd | ||
|
|
d761649d44 | ||
|
|
5da9cf5c3f | ||
|
|
d66a913089 | ||
|
|
8999640459 | ||
|
|
e8b5577def | ||
|
|
3c52a85169 | ||
|
|
0f7a473c65 | ||
|
|
8dae2b28a6 | ||
|
|
ce1e93ab26 | ||
|
|
28352740d9 | ||
|
|
8de78a29ff | ||
|
|
8d40d95f0b | ||
|
|
de4ea71842 | ||
|
|
e9f7aef7a3 | ||
|
|
8accc8a020 | ||
|
|
3feb261e1b | ||
|
|
9275d8277a | ||
|
|
2980dad4f5 | ||
|
|
a88d19b3ce | ||
|
|
91b968cc97 | ||
|
|
1e270389f6 | ||
|
|
a2649885a5 |
22
.drone.yml
22
.drone.yml
@@ -5,7 +5,7 @@ steps:
|
||||
image: nextcloudci/php7.2:php7.2-13
|
||||
environment:
|
||||
APP_NAME: deck
|
||||
CORE_BRANCH: master
|
||||
CORE_BRANCH: stable17
|
||||
DB: sqlite
|
||||
commands:
|
||||
# Pre-setup steps
|
||||
@@ -20,7 +20,7 @@ steps:
|
||||
image: nextcloudci/php7.2:php7.2-13
|
||||
environment:
|
||||
APP_NAME: deck
|
||||
CORE_BRANCH: master
|
||||
CORE_BRANCH: stable17
|
||||
DB: sqlite
|
||||
commands:
|
||||
- composer install
|
||||
@@ -29,7 +29,7 @@ steps:
|
||||
image: nextcloudci/php7.3:php7.3-2
|
||||
environment:
|
||||
APP_NAME: deck
|
||||
CORE_BRANCH: master
|
||||
CORE_BRANCH: stable17
|
||||
DB: sqlite
|
||||
commands:
|
||||
- composer install
|
||||
@@ -38,7 +38,7 @@ steps:
|
||||
image: nextcloudci/php7.4:2
|
||||
environment:
|
||||
APP_NAME: deck
|
||||
CORE_BRANCH: master
|
||||
CORE_BRANCH: stable17
|
||||
DB: sqlite
|
||||
commands:
|
||||
- composer install
|
||||
@@ -58,7 +58,7 @@ steps:
|
||||
image: nextcloudci/php7.2:php7.2-13
|
||||
environment:
|
||||
APP_NAME: deck
|
||||
CORE_BRANCH: master
|
||||
CORE_BRANCH: stable17
|
||||
DB: sqlite
|
||||
commands:
|
||||
# Pre-setup steps
|
||||
@@ -68,8 +68,8 @@ steps:
|
||||
- php occ app:enable deck
|
||||
- cd apps/$APP_NAME
|
||||
- composer install
|
||||
- phpunit -c tests/phpunit.xml --coverage-clover build/php-unit.coverage.xml
|
||||
- phpunit -c tests/phpunit.integration.xml --coverage-clover build/php-integration.coverage.xml
|
||||
- ./vendor/bin/phpunit -c tests/phpunit.xml --coverage-clover build/php-unit.coverage.xml
|
||||
- ./vendor/bin/phpunit -c tests/phpunit.integration.xml --coverage-clover build/php-integration.coverage.xml
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
@@ -85,7 +85,7 @@ steps:
|
||||
image: nextcloudci/php7.3:php7.3-5
|
||||
environment:
|
||||
APP_NAME: deck
|
||||
CORE_BRANCH: master
|
||||
CORE_BRANCH: stable17
|
||||
DB: sqlite
|
||||
commands:
|
||||
# Pre-setup steps
|
||||
@@ -95,8 +95,8 @@ steps:
|
||||
- php occ app:enable deck
|
||||
- cd apps/$APP_NAME
|
||||
- composer install
|
||||
- phpunit -c tests/phpunit.xml --coverage-clover build/php-unit.coverage.xml
|
||||
- phpunit -c tests/phpunit.integration.xml --coverage-clover build/php-integration.coverage.xml
|
||||
- ./vendor/bin/phpunit -c tests/phpunit.xml --coverage-clover build/php-unit.coverage.xml
|
||||
- ./vendor/bin/phpunit -c tests/phpunit.integration.xml --coverage-clover build/php-integration.coverage.xml
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
@@ -112,7 +112,7 @@ steps:
|
||||
image: nextcloudci/php7.2:php7.2-13
|
||||
environment:
|
||||
APP_NAME: deck
|
||||
CORE_BRANCH: master
|
||||
CORE_BRANCH: stable17
|
||||
DB: sqlite
|
||||
commands:
|
||||
# Pre-setup steps
|
||||
|
||||
31
.nextcloudignore
Normal file
31
.nextcloudignore
Normal file
@@ -0,0 +1,31 @@
|
||||
/build/
|
||||
/.git
|
||||
/js/node_modules
|
||||
/js/tests
|
||||
/js/legacy
|
||||
/js/controller
|
||||
/js/directive
|
||||
/js/filters
|
||||
/js/service
|
||||
/js/bower.json
|
||||
/js/.bowerrc
|
||||
/js/.jshintrc
|
||||
/js/Gruntfile.js
|
||||
/js/package.json
|
||||
/js/package-lock.json
|
||||
/docs/
|
||||
/tests
|
||||
/.codecov.yml
|
||||
/composer.json
|
||||
/composer.lock
|
||||
/_config.yml
|
||||
/.drone.yml
|
||||
/.travis.yml
|
||||
/.eslintignore
|
||||
/.eslintrc.yml
|
||||
/.gitignore
|
||||
/issue_template.md
|
||||
/krankerl.toml
|
||||
/Makefile
|
||||
/mkdocs.yml
|
||||
/run-eslint.sh
|
||||
@@ -5,7 +5,7 @@ php:
|
||||
- 7.2
|
||||
- 7.3
|
||||
env:
|
||||
- CORE_BRANCH=master DB=mysql
|
||||
- CORE_BRANCH=stable17 DB=mysql
|
||||
|
||||
before_install:
|
||||
- export PATH="$PWD/vendor/bin:$PATH"
|
||||
|
||||
20
CHANGELOG.md
20
CHANGELOG.md
@@ -1,6 +1,26 @@
|
||||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## 0.8.3 - 2020-06-26
|
||||
|
||||
### Fixed
|
||||
|
||||
- Bump dependencies
|
||||
|
||||
## 0.8.2 - 2020-04-08
|
||||
|
||||
## Fixed
|
||||
- Fix build with missing javascript bundles
|
||||
|
||||
## 0.8.1 - 2020-04-08
|
||||
|
||||
## Added
|
||||
- Nextcloud 19 compatibility
|
||||
|
||||
## Fixed
|
||||
- Let new shares only use the current users permissions
|
||||
- Check for board membership on comments entity event
|
||||
|
||||
## 0.8.0 - 2020-01-16
|
||||
|
||||
## Added
|
||||
|
||||
12
Makefile
12
Makefile
@@ -81,16 +81,8 @@ test: test-unit test-integration
|
||||
|
||||
test-unit:
|
||||
mkdir -p build/
|
||||
ifeq (, $(shell which phpunit 2> /dev/null))
|
||||
@echo "No phpunit command available, downloading a copy from the web"
|
||||
mkdir -p $(build_tools_directory)
|
||||
curl -sSL https://phar.phpunit.de/phpunit-8.2.phar -o $(build_tools_directory)/phpunit.phar
|
||||
php $(build_tools_directory)/phpunit.phar -c tests/phpunit.xml --coverage-clover build/php-unit.coverage.xml
|
||||
php $(build_tools_directory)/phpunit.phar -c tests/phpunit.integration.xml --coverage-clover build/php-integration.coverage.xml
|
||||
else
|
||||
phpunit -c tests/phpunit.xml --coverage-clover build/php-unit.coverage.xml
|
||||
phpunit -c tests/phpunit.integration.xml --coverage-clover build/php-integration.coverage.xml
|
||||
endif
|
||||
./vendor/bin/phpunit -c tests/phpunit.xml --coverage-clover build/php-unit.coverage.xml
|
||||
./vendor/bin/phpunit -c tests/phpunit.integration.xml --coverage-clover build/php-integration.coverage.xml
|
||||
|
||||
test-integration:
|
||||
cd tests/integration && ./run.sh
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
- 🚀 Get your project organized
|
||||
|
||||
</description>
|
||||
<version>0.8.0</version>
|
||||
<version>0.8.3</version>
|
||||
<licence>agpl</licence>
|
||||
<author>Julius Härtl</author>
|
||||
<namespace>Deck</namespace>
|
||||
@@ -36,7 +36,7 @@
|
||||
<database min-version="9.4">pgsql</database>
|
||||
<database>sqlite</database>
|
||||
<database min-version="5.5">mysql</database>
|
||||
<nextcloud min-version="17" max-version="19" />
|
||||
<nextcloud min-version="17" max-version="17" />
|
||||
</dependencies>
|
||||
<background-jobs>
|
||||
<job>OCA\Deck\Cron\DeleteCron</job>
|
||||
|
||||
@@ -15,6 +15,6 @@
|
||||
"roave/security-advisories": "dev-master",
|
||||
"christophwurst/nextcloud": "^17",
|
||||
"jakub-onderka/php-parallel-lint": "^1.0.0",
|
||||
"phpunit/phpunit": "^8"
|
||||
"phpunit/phpunit": "6.5.*"
|
||||
}
|
||||
}
|
||||
|
||||
4834
js/package-lock.json
generated
4834
js/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -7,12 +7,12 @@
|
||||
"test": "tests"
|
||||
},
|
||||
"dependencies": {
|
||||
"@uirouter/angularjs": "^1.0.24",
|
||||
"angular": "^1.7.9",
|
||||
"angular-animate": "^1.7.9",
|
||||
"angular-file-upload": "^2.5.0",
|
||||
"@uirouter/angularjs": "^1.0.28",
|
||||
"angular": "^1.8.0",
|
||||
"angular-animate": "^1.8.0",
|
||||
"angular-file-upload": "^2.6.1",
|
||||
"angular-markdown-it": "^0.6.1",
|
||||
"angular-sanitize": "^1.7.9",
|
||||
"angular-sanitize": "^1.8.0",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"markdown-it": "^10.0.0",
|
||||
"markdown-it-link-target": "^1.0.2",
|
||||
@@ -22,25 +22,26 @@
|
||||
"ng-infinite-scroll": "^1.3.0",
|
||||
"ng-sortable": "^1.3.8",
|
||||
"ui-select": "^0.19.8",
|
||||
"vue": "^2.6.11",
|
||||
"vuex": "^3.1.2"
|
||||
"vue": "^2.6.12",
|
||||
"vuex": "^3.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.8.3",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
|
||||
"@babel/polyfill": "^7.8.3",
|
||||
"@babel/preset-env": "^7.8.3",
|
||||
"babel-loader": "^8.0.6",
|
||||
"css-loader": "^3.4.2",
|
||||
"karma": "^4.4.1",
|
||||
"@babel/core": "^7.11.4",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
||||
"@babel/polyfill": "^7.10.4",
|
||||
"@babel/preset-env": "^7.11.0",
|
||||
"babel-loader": "^8.1.0",
|
||||
"css-loader": "^3.6.0",
|
||||
"karma": "^5.1.1",
|
||||
"mini-css-extract-plugin": "^0.9.0",
|
||||
"style-loader": "^1.1.3",
|
||||
"url-loader": "^3.0.0",
|
||||
"vue-loader": "^15.8.3",
|
||||
"minimist": "^1.2.5",
|
||||
"style-loader": "^1.2.1",
|
||||
"url-loader": "^4.1.0",
|
||||
"vue-loader": "^15.9.3",
|
||||
"vue-style-loader": "^4.1.2",
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"webpack": "^4.41.5",
|
||||
"webpack-cli": "^3.3.10",
|
||||
"vue-template-compiler": "^2.6.12",
|
||||
"webpack": "^4.44.1",
|
||||
"webpack-cli": "^3.3.12",
|
||||
"webpack-merge": "^4.2.2"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,38 +1,4 @@
|
||||
[package]
|
||||
exclude = [
|
||||
"build/",
|
||||
".git",
|
||||
"js/node_modules",
|
||||
"js/tests",
|
||||
"js/legacy",
|
||||
"js/controller",
|
||||
"js/directive",
|
||||
"js/filters",
|
||||
"js/service",
|
||||
"js/bower.json",
|
||||
"js/.bowerrc",
|
||||
"js/.jshintrc",
|
||||
"js/Gruntfile.js",
|
||||
"js/package.json",
|
||||
"js/package-lock.json",
|
||||
"docs/",
|
||||
"tests",
|
||||
".codecov.yml",
|
||||
"composer.json",
|
||||
"composer.lock",
|
||||
"_config.yml",
|
||||
".drone.yml",
|
||||
".travis.yml",
|
||||
".eslintignore",
|
||||
".eslintrc.yml",
|
||||
".gitignore",
|
||||
"issue_template.md",
|
||||
"krankerl.toml",
|
||||
"Makefile",
|
||||
"mkdocs.yml",
|
||||
"run-eslint.sh"
|
||||
]
|
||||
|
||||
before_cmds = [
|
||||
'make clean-build',
|
||||
'make build'
|
||||
|
||||
@@ -33,6 +33,7 @@ use OCA\Deck\Db\CardMapper;
|
||||
use OCA\Deck\Middleware\ExceptionMiddleware;
|
||||
use OCA\Deck\Notification\Notifier;
|
||||
use OCA\Deck\Service\FullTextSearchService;
|
||||
use OCA\Deck\Service\PermissionService;
|
||||
use OCP\AppFramework\App;
|
||||
use OCP\Collaboration\Resources\IManager;
|
||||
use OCP\Comments\CommentsEntityEvent;
|
||||
@@ -151,13 +152,14 @@ class Application extends App {
|
||||
$this->getContainer()->getServer()->getEventDispatcher()->addListener(CommentsEntityEvent::EVENT_ENTITY, function(CommentsEntityEvent $event) {
|
||||
$event->addEntityCollection('deckCard', function($name) {
|
||||
/** @var CardMapper */
|
||||
$service = $this->getContainer()->query(CardMapper::class);
|
||||
$cardMapper = $this->getContainer()->query(CardMapper::class);
|
||||
$permissionService = $this->getContainer()->query(PermissionService::class);
|
||||
|
||||
try {
|
||||
$service->find((int) $name);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
return $permissionService->checkPermission($cardMapper, (int) $name, Acl::PERMISSION_READ);
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
});
|
||||
$this->registerCommentsEventHandler();
|
||||
|
||||
@@ -454,6 +454,17 @@ class BoardService {
|
||||
return $board;
|
||||
}
|
||||
|
||||
private function applyPermissions($boardId, $edit, $share, $manage) {
|
||||
try {
|
||||
$this->permissionService->checkPermission($this->boardMapper, $boardId, Acl::PERMISSION_MANAGE);
|
||||
} catch (NoPermissionException $e) {
|
||||
$acls = $this->aclMapper->findAll($boardId);
|
||||
$edit = $this->permissionService->userCan($acls, Acl::PERMISSION_EDIT, $this->userId) && $edit;
|
||||
$share = $this->permissionService->userCan($acls, Acl::PERMISSION_SHARE, $this->userId) && $share;
|
||||
$manage = $this->permissionService->userCan($acls, Acl::PERMISSION_MANAGE, $this->userId) && $manage;
|
||||
}
|
||||
return [$edit, $share, $manage];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $boardId
|
||||
@@ -493,6 +504,8 @@ class BoardService {
|
||||
}
|
||||
|
||||
$this->permissionService->checkPermission($this->boardMapper, $boardId, Acl::PERMISSION_SHARE);
|
||||
[$edit, $share, $manage] = $this->applyPermissions($boardId, $edit, $share, $manage);
|
||||
|
||||
$acl = new Acl();
|
||||
$acl->setBoardId($boardId);
|
||||
$acl->setType($type);
|
||||
@@ -555,8 +568,10 @@ class BoardService {
|
||||
}
|
||||
|
||||
$this->permissionService->checkPermission($this->aclMapper, $id, Acl::PERMISSION_SHARE);
|
||||
|
||||
/** @var Acl $acl */
|
||||
$acl = $this->aclMapper->find($id);
|
||||
[$edit, $share, $manage] = $this->applyPermissions($acl->getBoardId(), $edit, $share, $manage);
|
||||
$acl->setPermissionEdit($edit);
|
||||
$acl->setPermissionShare($share);
|
||||
$acl->setPermissionManage($manage);
|
||||
|
||||
@@ -97,7 +97,7 @@ class ActivityManagerTest extends TestCase {
|
||||
if (strpos($constant, 'SUBJECT') === 0) {
|
||||
$format = $this->activityManager->getActivityFormat($value, [], false);
|
||||
if ($format !== '') {
|
||||
$this->assertStringContainsString('{user}', $format);
|
||||
$this->assertContains('{user}', $format);
|
||||
} else {
|
||||
/** @noinspection ForgottenDebugOutputInspection */
|
||||
print_r('No activity string found for '. $constant . PHP_EOL);
|
||||
|
||||
@@ -34,6 +34,7 @@ use OCA\Deck\Db\BoardMapper;
|
||||
use OCA\Deck\Db\ChangeHelper;
|
||||
use OCA\Deck\Db\LabelMapper;
|
||||
use OCA\Deck\Db\StackMapper;
|
||||
use OCA\Deck\NoPermissionException;
|
||||
use OCA\Deck\Notification\NotificationHelper;
|
||||
use OCP\IUser;
|
||||
use OCP\IUserManager;
|
||||
@@ -260,6 +261,93 @@ class BoardServiceTest extends TestCase {
|
||||
));
|
||||
}
|
||||
|
||||
public function dataAddAclExtendPermission() {
|
||||
return [
|
||||
[[false, false, false], [false, false, false], [false, false, false]],
|
||||
[[false, false, false], [true, true, true], [false, false, false]],
|
||||
|
||||
// user has share permissions -> can only reshare with those
|
||||
[[false, true, false], [false, false, false], [false, false, false]],
|
||||
[[false, true, false], [false, true, false], [false, true, false]],
|
||||
[[false, true, false], [true, true, true], [false, true, false]],
|
||||
|
||||
// user has write permissions -> can only reshare with those
|
||||
[[true, true, false], [false, false, false], [false, false, false]],
|
||||
[[true, true, false], [false, true, false], [false, true, false]],
|
||||
[[true, true, false], [true, true, true], [true, true, false]],
|
||||
|
||||
// user has manage permissions -> can upgrade acl permissions
|
||||
[[false, false, true], [true, true, true], [true, true, true]],
|
||||
[[true, true, true], [false, false, true], [false, false, true]],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider dataAddAclExtendPermission
|
||||
* @param $currentUserAcl
|
||||
* @param $providedAcl
|
||||
* @param $resultingAcl
|
||||
* @throws NoPermissionException
|
||||
* @throws \OCA\Deck\BadRequestException
|
||||
*/
|
||||
public function testAddAclExtendPermission($currentUserAcl, $providedAcl, $resultingAcl) {
|
||||
$existingAcl = new Acl();
|
||||
$existingAcl->setBoardId(123);
|
||||
$existingAcl->setType('user');
|
||||
$existingAcl->setParticipant('admin');
|
||||
$existingAcl->setPermissionEdit($currentUserAcl[0]);
|
||||
$existingAcl->setPermissionShare($currentUserAcl[1]);
|
||||
$existingAcl->setPermissionManage($currentUserAcl[2]);
|
||||
$this->permissionService->expects($this->at(0))
|
||||
->method('checkPermission')
|
||||
->with($this->boardMapper, 123, Acl::PERMISSION_SHARE, null);
|
||||
if ($currentUserAcl[2]) {
|
||||
$this->permissionService->expects($this->at(1))
|
||||
->method('checkPermission')
|
||||
->with($this->boardMapper, 123, Acl::PERMISSION_MANAGE, null);
|
||||
} else {
|
||||
$this->aclMapper->expects($this->once())
|
||||
->method('findAll')
|
||||
->willReturn([$existingAcl]);
|
||||
$this->permissionService->expects($this->at(1))
|
||||
->method('checkPermission')
|
||||
->with($this->boardMapper, 123, Acl::PERMISSION_MANAGE, null)
|
||||
->willThrowException(new NoPermissionException('No permission'));
|
||||
$this->permissionService->expects($this->at(2))
|
||||
->method('userCan')
|
||||
->willReturn($currentUserAcl[0]);
|
||||
$this->permissionService->expects($this->at(3))
|
||||
->method('userCan')
|
||||
->willReturn($currentUserAcl[1]);
|
||||
$this->permissionService->expects($this->at(4))
|
||||
->method('userCan')
|
||||
->willReturn($currentUserAcl[2]);
|
||||
}
|
||||
|
||||
$user = $this->createMock(IUser::class);
|
||||
$user->method('getUID')->willReturn('admin');
|
||||
$acl = new Acl();
|
||||
$acl->setBoardId(123);
|
||||
$acl->setType('user');
|
||||
$acl->setParticipant('admin');
|
||||
$acl->setPermissionEdit($resultingAcl[0]);
|
||||
$acl->setPermissionShare($resultingAcl[1]);
|
||||
$acl->setPermissionManage($resultingAcl[2]);
|
||||
$acl->resolveRelation('participant', function($participant) use (&$user) {
|
||||
return null;
|
||||
});
|
||||
$this->notificationHelper->expects($this->once())
|
||||
->method('sendBoardShared');
|
||||
$expected = clone $acl;
|
||||
$this->aclMapper->expects($this->once())
|
||||
->method('insert')
|
||||
->with($acl)
|
||||
->willReturn($acl);
|
||||
$this->assertEquals($expected, $this->service->addAcl(
|
||||
123, 'user', 'admin', $providedAcl[0], $providedAcl[1], $providedAcl[2]
|
||||
));
|
||||
}
|
||||
|
||||
public function testUpdateAcl() {
|
||||
$acl = new Acl();
|
||||
$acl->setBoardId(123);
|
||||
|
||||
Reference in New Issue
Block a user