MailPluginTest.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2017 Arthur Schiwon <blizzz@arthur-schiwon.de>
  4. *
  5. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  6. *
  7. * @license GNU AGPL version 3 or any later version
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License as
  11. * published by the Free Software Foundation, either version 3 of the
  12. * License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. *
  22. */
  23. namespace Test\Collaboration\Collaborators;
  24. use OC\Collaboration\Collaborators\MailPlugin;
  25. use OC\Collaboration\Collaborators\SearchResult;
  26. use OC\Federation\CloudIdManager;
  27. use OCP\Collaboration\Collaborators\SearchResultType;
  28. use OCP\Contacts\IManager;
  29. use OCP\Federation\ICloudIdManager;
  30. use OCP\IConfig;
  31. use OCP\IGroupManager;
  32. use OCP\IUser;
  33. use OCP\IUserSession;
  34. use OCP\Share;
  35. use Test\TestCase;
  36. class MailPluginTest extends TestCase {
  37. /** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */
  38. protected $config;
  39. /** @var IManager|\PHPUnit_Framework_MockObject_MockObject */
  40. protected $contactsManager;
  41. /** @var ICloudIdManager|\PHPUnit_Framework_MockObject_MockObject */
  42. protected $cloudIdManager;
  43. /** @var MailPlugin */
  44. protected $plugin;
  45. /** @var SearchResult */
  46. protected $searchResult;
  47. /** @var IGroupManager|\PHPUnit_Framework_MockObject_MockObject */
  48. protected $groupManager;
  49. /** @var IUserSession|\PHPUnit_Framework_MockObject_MockObject */
  50. protected $userSession;
  51. public function setUp() {
  52. parent::setUp();
  53. $this->config = $this->createMock(IConfig::class);
  54. $this->contactsManager = $this->createMock(IManager::class);
  55. $this->groupManager = $this->createMock(IGroupManager::class);
  56. $this->userSession = $this->createMock(IUserSession::class);
  57. $this->cloudIdManager = new CloudIdManager();
  58. $this->searchResult = new SearchResult();
  59. }
  60. public function instantiatePlugin() {
  61. $this->plugin = new MailPlugin($this->contactsManager, $this->cloudIdManager, $this->config, $this->groupManager, $this->userSession);
  62. }
  63. /**
  64. * @dataProvider dataGetEmail
  65. *
  66. * @param string $searchTerm
  67. * @param array $contacts
  68. * @param bool $shareeEnumeration
  69. * @param array $expected
  70. * @param bool $reachedEnd
  71. */
  72. public function testSearch($searchTerm, $contacts, $shareeEnumeration, $expected, $exactIdMatch, $reachedEnd) {
  73. $this->config->expects($this->any())
  74. ->method('getAppValue')
  75. ->willReturnCallback(
  76. function($appName, $key, $default)
  77. use ($shareeEnumeration)
  78. {
  79. if ($appName === 'core' && $key === 'shareapi_allow_share_dialog_user_enumeration') {
  80. return $shareeEnumeration ? 'yes' : 'no';
  81. }
  82. return $default;
  83. }
  84. );
  85. $this->instantiatePlugin();
  86. $currentUser = $this->createMock(IUser::class);
  87. $currentUser->method('getUID')
  88. ->willReturn('current');
  89. $this->userSession->method('getUser')
  90. ->willReturn($currentUser);
  91. $this->contactsManager->expects($this->any())
  92. ->method('search')
  93. ->with($searchTerm, ['EMAIL', 'FN'])
  94. ->willReturn($contacts);
  95. $moreResults = $this->plugin->search($searchTerm, 2, 0, $this->searchResult);
  96. $result = $this->searchResult->asArray();
  97. $this->assertSame($exactIdMatch, $this->searchResult->hasExactIdMatch(new SearchResultType('emails')));
  98. $this->assertEquals($expected, $result);
  99. $this->assertSame($reachedEnd, $moreResults);
  100. }
  101. public function dataGetEmail() {
  102. return [
  103. // data set 0
  104. ['test', [], true, ['emails' => [], 'exact' => ['emails' => []]], false, false],
  105. // data set 1
  106. ['test', [], false, ['emails' => [], 'exact' => ['emails' => []]], false, false],
  107. // data set 2
  108. [
  109. 'test@remote.com',
  110. [],
  111. true,
  112. ['emails' => [], 'exact' => ['emails' => [['uuid' => 'test@remote.com', 'label' => 'test@remote.com', 'value' => ['shareType' => Share::SHARE_TYPE_EMAIL, 'shareWith' => 'test@remote.com']]]]],
  113. false,
  114. false,
  115. ],
  116. // data set 3
  117. [ // no valid email address
  118. 'test@remote',
  119. [],
  120. true,
  121. ['emails' => [], 'exact' => ['emails' => []]],
  122. false,
  123. false,
  124. ],
  125. // data set 4
  126. [
  127. 'test@remote.com',
  128. [],
  129. false,
  130. ['emails' => [], 'exact' => ['emails' => [['uuid' => 'test@remote.com', 'label' => 'test@remote.com', 'value' => ['shareType' => Share::SHARE_TYPE_EMAIL, 'shareWith' => 'test@remote.com']]]]],
  131. false,
  132. false,
  133. ],
  134. // data set 5
  135. [
  136. 'test',
  137. [
  138. [
  139. 'UID' => 'uid3',
  140. 'FN' => 'User3 @ Localhost',
  141. ],
  142. [
  143. 'UID' => 'uid2',
  144. 'FN' => 'User2 @ Localhost',
  145. 'EMAIL' => [
  146. ],
  147. ],
  148. [
  149. 'UID' => 'uid1',
  150. 'FN' => 'User @ Localhost',
  151. 'EMAIL' => [
  152. 'username@localhost',
  153. ],
  154. ],
  155. ],
  156. true,
  157. ['emails' => [['uuid' => 'uid1', 'name' => 'User @ Localhost', 'type' => '', 'label' => 'User @ Localhost (username@localhost)', 'value' => ['shareType' => Share::SHARE_TYPE_EMAIL, 'shareWith' => 'username@localhost']]], 'exact' => ['emails' => []]],
  158. false,
  159. false,
  160. ],
  161. // data set 6
  162. [
  163. 'test',
  164. [
  165. [
  166. 'UID' => 'uid3',
  167. 'FN' => 'User3 @ Localhost',
  168. ],
  169. [
  170. 'UID' => 'uid2',
  171. 'FN' => 'User2 @ Localhost',
  172. 'EMAIL' => [
  173. ],
  174. ],
  175. [
  176. 'UID' => 'uid1',
  177. 'FN' => 'User @ Localhost',
  178. 'EMAIL' => [
  179. 'username@localhost',
  180. ],
  181. ],
  182. ],
  183. false,
  184. ['emails' => [], 'exact' => ['emails' => []]],
  185. false,
  186. false,
  187. ],
  188. // data set 7
  189. [
  190. 'test@remote.com',
  191. [
  192. [
  193. 'UID' => 'uid3',
  194. 'FN' => 'User3 @ Localhost',
  195. ],
  196. [
  197. 'UID' => 'uid2',
  198. 'FN' => 'User2 @ Localhost',
  199. 'EMAIL' => [
  200. ],
  201. ],
  202. [
  203. 'UID' => 'uid1',
  204. 'FN' => 'User @ Localhost',
  205. 'EMAIL' => [
  206. 'username@localhost',
  207. ],
  208. ],
  209. ],
  210. true,
  211. ['emails' => [['uuid' => 'uid1', 'name' => 'User @ Localhost', 'type' => '', 'label' => 'User @ Localhost (username@localhost)', 'value' => ['shareType' => Share::SHARE_TYPE_EMAIL, 'shareWith' => 'username@localhost']]], 'exact' => ['emails' => [['label' => 'test@remote.com', 'uuid' => 'test@remote.com', 'value' => ['shareType' => Share::SHARE_TYPE_EMAIL, 'shareWith' => 'test@remote.com']]]]],
  212. false,
  213. false,
  214. ],
  215. // data set 8
  216. [
  217. 'test@remote.com',
  218. [
  219. [
  220. 'UID' => 'uid3',
  221. 'FN' => 'User3 @ Localhost',
  222. ],
  223. [
  224. 'UID' => 'uid2',
  225. 'FN' => 'User2 @ Localhost',
  226. 'EMAIL' => [
  227. ],
  228. ],
  229. [
  230. 'UID' => 'uid1',
  231. 'FN' => 'User @ Localhost',
  232. 'EMAIL' => [
  233. 'username@localhost',
  234. ],
  235. ],
  236. ],
  237. false,
  238. ['emails' => [], 'exact' => ['emails' => [['label' => 'test@remote.com', 'uuid' => 'test@remote.com', 'value' => ['shareType' => Share::SHARE_TYPE_EMAIL, 'shareWith' => 'test@remote.com']]]]],
  239. false,
  240. false,
  241. ],
  242. // data set 9
  243. [
  244. 'username@localhost',
  245. [
  246. [
  247. 'UID' => 'uid3',
  248. 'FN' => 'User3 @ Localhost',
  249. ],
  250. [
  251. 'UID' => 'uid2',
  252. 'FN' => 'User2 @ Localhost',
  253. 'EMAIL' => [
  254. ],
  255. ],
  256. [
  257. 'UID' => 'uid1',
  258. 'FN' => 'User @ Localhost',
  259. 'EMAIL' => [
  260. 'username@localhost',
  261. ],
  262. ],
  263. ],
  264. true,
  265. ['emails' => [], 'exact' => ['emails' => [['name' => 'User @ Localhost', 'uuid' => 'uid1', 'type' => '', 'label' => 'User @ Localhost (username@localhost)', 'value' => ['shareType' => Share::SHARE_TYPE_EMAIL, 'shareWith' => 'username@localhost']]]]],
  266. true,
  267. false,
  268. ],
  269. // data set 10
  270. [
  271. 'username@localhost',
  272. [
  273. [
  274. 'UID' => 'uid1',
  275. 'FN' => 'User3 @ Localhost',
  276. ],
  277. [
  278. 'UID' => 'uid2',
  279. 'FN' => 'User2 @ Localhost',
  280. 'EMAIL' => [
  281. ],
  282. ],
  283. [
  284. 'UID' => 'uid1',
  285. 'FN' => 'User @ Localhost',
  286. 'EMAIL' => [
  287. 'username@localhost',
  288. ],
  289. ],
  290. ],
  291. false,
  292. ['emails' => [], 'exact' => ['emails' => [['name' => 'User @ Localhost', 'uuid' => 'uid1', 'type' => '', 'label' => 'User @ Localhost (username@localhost)', 'value' => ['shareType' => Share::SHARE_TYPE_EMAIL, 'shareWith' => 'username@localhost']]]]],
  293. true,
  294. false,
  295. ],
  296. // data set 11
  297. // contact with space
  298. [
  299. 'user name@localhost',
  300. [
  301. [
  302. 'UID' => 'uid3',
  303. 'FN' => 'User3 @ Localhost',
  304. ],
  305. [
  306. 'UID' => 'uid2',
  307. 'FN' => 'User2 @ Localhost',
  308. 'EMAIL' => [
  309. ],
  310. ],
  311. [
  312. 'UID' => 'uid1',
  313. 'FN' => 'User Name @ Localhost',
  314. 'EMAIL' => [
  315. 'user name@localhost',
  316. ],
  317. ],
  318. ],
  319. false,
  320. ['emails' => [], 'exact' => ['emails' => [['name' => 'User Name @ Localhost', 'uuid' => 'uid1', 'type' => '', 'label' => 'User Name @ Localhost (user name@localhost)', 'value' => ['shareType' => Share::SHARE_TYPE_EMAIL, 'shareWith' => 'user name@localhost']]]]],
  321. true,
  322. false,
  323. ],
  324. // data set 12
  325. // remote with space, no contact
  326. [
  327. 'user space@remote.com',
  328. [
  329. [
  330. 'UID' => 'uid3',
  331. 'FN' => 'User3 @ Localhost',
  332. ],
  333. [
  334. 'UID' => 'uid2',
  335. 'FN' => 'User2 @ Localhost',
  336. 'EMAIL' => [
  337. ],
  338. ],
  339. [
  340. 'UID' => 'uid1',
  341. 'FN' => 'User @ Localhost',
  342. 'EMAIL' => [
  343. 'username@localhost',
  344. ],
  345. ],
  346. ],
  347. false,
  348. ['emails' => [], 'exact' => ['emails' => []]],
  349. false,
  350. false,
  351. ],
  352. // data set 13
  353. // Local user found by email
  354. [
  355. 'test@example.com',
  356. [
  357. [
  358. 'UID' => 'uid1',
  359. 'FN' => 'User',
  360. 'EMAIL' => ['test@example.com'],
  361. 'CLOUD' => ['test@localhost'],
  362. 'isLocalSystemBook' => true,
  363. ]
  364. ],
  365. false,
  366. ['users' => [], 'exact' => ['users' => [['uuid' => 'uid1', 'name' => 'User', 'label' => 'User (test@example.com)','value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test'],]]]],
  367. true,
  368. false,
  369. ],
  370. // data set 14
  371. // Current local user found by email => no result
  372. [
  373. 'test@example.com',
  374. [
  375. [
  376. 'UID' => 'uid1',
  377. 'FN' => 'User',
  378. 'EMAIL' => ['test@example.com'],
  379. 'CLOUD' => ['current@localhost'],
  380. 'isLocalSystemBook' => true,
  381. ]
  382. ],
  383. true,
  384. ['exact' => []],
  385. false,
  386. false,
  387. ],
  388. // data set 15
  389. // Pagination and "more results" for user matches byyyyyyy emails
  390. [
  391. 'test@example',
  392. [
  393. [
  394. 'UID' => 'uid1',
  395. 'FN' => 'User1',
  396. 'EMAIL' => ['test@example.com'],
  397. 'CLOUD' => ['test1@localhost'],
  398. 'isLocalSystemBook' => true,
  399. ],
  400. [
  401. 'UID' => 'uid2',
  402. 'FN' => 'User2',
  403. 'EMAIL' => ['test@example.de'],
  404. 'CLOUD' => ['test2@localhost'],
  405. 'isLocalSystemBook' => true,
  406. ],
  407. [
  408. 'UID' => 'uid3',
  409. 'FN' => 'User3',
  410. 'EMAIL' => ['test@example.org'],
  411. 'CLOUD' => ['test3@localhost'],
  412. 'isLocalSystemBook' => true,
  413. ],
  414. [
  415. 'UID' => 'uid4',
  416. 'FN' => 'User4',
  417. 'EMAIL' => ['test@example.net'],
  418. 'CLOUD' => ['test4@localhost'],
  419. 'isLocalSystemBook' => true,
  420. ],
  421. ],
  422. true,
  423. ['users' => [
  424. ['uuid' => 'uid1', 'name' => 'User1', 'label' => 'User1 (test@example.com)', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test1']],
  425. ['uuid' => 'uid2', 'name' => 'User2', 'label' => 'User2 (test@example.de)', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test2']],
  426. ], 'emails' => [], 'exact' => ['users' => [], 'emails' => []]],
  427. false,
  428. true,
  429. ],
  430. // data set 16
  431. // Pagination and "more results" for normal emails
  432. [
  433. 'test@example',
  434. [
  435. [
  436. 'UID' => 'uid1',
  437. 'FN' => 'User1',
  438. 'EMAIL' => ['test@example.com'],
  439. 'CLOUD' => ['test1@localhost'],
  440. ],
  441. [
  442. 'UID' => 'uid2',
  443. 'FN' => 'User2',
  444. 'EMAIL' => ['test@example.de'],
  445. 'CLOUD' => ['test2@localhost'],
  446. ],
  447. [
  448. 'UID' => 'uid3',
  449. 'FN' => 'User3',
  450. 'EMAIL' => ['test@example.org'],
  451. 'CLOUD' => ['test3@localhost'],
  452. ],
  453. [
  454. 'UID' => 'uid4',
  455. 'FN' => 'User4',
  456. 'EMAIL' => ['test@example.net'],
  457. 'CLOUD' => ['test4@localhost'],
  458. ],
  459. ],
  460. true,
  461. ['emails' => [
  462. ['uuid' => 'uid1', 'name' => 'User1', 'type' => '', 'label' => 'User1 (test@example.com)', 'value' => ['shareType' => Share::SHARE_TYPE_EMAIL, 'shareWith' => 'test@example.com']],
  463. ['uuid' => 'uid2', 'name' => 'User2', 'type' => '', 'label' => 'User2 (test@example.de)', 'value' => ['shareType' => Share::SHARE_TYPE_EMAIL, 'shareWith' => 'test@example.de']],
  464. ], 'exact' => ['emails' => []]],
  465. false,
  466. true,
  467. ],
  468. // data set 17
  469. // multiple email addresses with type
  470. [
  471. 'User Name',
  472. [
  473. [
  474. 'UID' => 'uid3',
  475. 'FN' => 'User3',
  476. ],
  477. [
  478. 'UID' => 'uid2',
  479. 'FN' => 'User2',
  480. 'EMAIL' => [
  481. ],
  482. ],
  483. [
  484. 'UID' => 'uid1',
  485. 'FN' => 'User Name',
  486. 'EMAIL' => [
  487. ['type' => 'HOME', 'value' => 'username@localhost'],
  488. ['type' => 'WORK', 'value' => 'username@other'],
  489. ],
  490. ],
  491. ],
  492. false,
  493. ['emails' => [
  494. ], 'exact' => ['emails' => [
  495. ['name' => 'User Name', 'uuid' => 'uid1', 'type' => 'HOME', 'label' => 'User Name (username@localhost)', 'value' => ['shareType' => Share::SHARE_TYPE_EMAIL, 'shareWith' => 'username@localhost']],
  496. ['name' => 'User Name', 'uuid' => 'uid1', 'type' => 'WORK', 'label' => 'User Name (username@other)', 'value' => ['shareType' => Share::SHARE_TYPE_EMAIL, 'shareWith' => 'username@other']]
  497. ]]],
  498. false,
  499. false,
  500. ],
  501. ];
  502. }
  503. /**
  504. * @dataProvider dataGetEmailGroupsOnly
  505. *
  506. * @param string $searchTerm
  507. * @param array $contacts
  508. * @param array $expected
  509. * @param bool $exactIdMatch
  510. * @param bool $reachedEnd
  511. * @param array groups
  512. */
  513. public function testSearchGroupsOnly($searchTerm, $contacts, $expected, $exactIdMatch, $reachedEnd, $userToGroupMapping) {
  514. $this->config->expects($this->any())
  515. ->method('getAppValue')
  516. ->willReturnCallback(
  517. function($appName, $key, $default) {
  518. if ($appName === 'core' && $key === 'shareapi_allow_share_dialog_user_enumeration') {
  519. return 'yes';
  520. } else if ($appName === 'core' && $key === 'shareapi_only_share_with_group_members') {
  521. return 'yes';
  522. }
  523. return $default;
  524. }
  525. );
  526. $this->instantiatePlugin();
  527. /** @var \OCP\IUser | \PHPUnit_Framework_MockObject_MockObject */
  528. $currentUser = $this->createMock('\OCP\IUser');
  529. $currentUser->expects($this->any())
  530. ->method('getUID')
  531. ->willReturn('currentUser');
  532. $this->contactsManager->expects($this->any())
  533. ->method('search')
  534. ->with($searchTerm, ['EMAIL', 'FN'])
  535. ->willReturn($contacts);
  536. $this->userSession->expects($this->any())
  537. ->method('getUser')
  538. ->willReturn($currentUser);
  539. $this->groupManager->expects($this->any())
  540. ->method('getUserGroupIds')
  541. ->willReturnCallback(function(\OCP\IUser $user) use ($userToGroupMapping) {
  542. return $userToGroupMapping[$user->getUID()];
  543. });
  544. $this->groupManager->expects($this->any())
  545. ->method('isInGroup')
  546. ->willReturnCallback(function($userId, $group) use ($userToGroupMapping) {
  547. return in_array($group, $userToGroupMapping[$userId]);
  548. });
  549. $moreResults = $this->plugin->search($searchTerm, 2, 0, $this->searchResult);
  550. $result = $this->searchResult->asArray();
  551. $this->assertSame($exactIdMatch, $this->searchResult->hasExactIdMatch(new SearchResultType('emails')));
  552. $this->assertEquals($expected, $result);
  553. $this->assertSame($reachedEnd, $moreResults);
  554. }
  555. public function dataGetEmailGroupsOnly() {
  556. return [
  557. // The user `User` can share with the current user
  558. [
  559. 'test',
  560. [
  561. [
  562. 'FN' => 'User',
  563. 'EMAIL' => ['test@example.com'],
  564. 'CLOUD' => ['test@localhost'],
  565. 'isLocalSystemBook' => true,
  566. 'UID' => 'User'
  567. ]
  568. ],
  569. ['users' => [['label' => 'User (test@example.com)', 'uuid' => 'User', 'name' => 'User', 'value' => ['shareType' => 0, 'shareWith' => 'test'],]], 'emails' => [], 'exact' => ['emails' => [], 'users' => []]],
  570. false,
  571. false,
  572. [
  573. "currentUser" => ["group1"],
  574. "User" => ["group1"]
  575. ]
  576. ],
  577. // The user `User` cannot share with the current user
  578. [
  579. 'test',
  580. [
  581. [
  582. 'FN' => 'User',
  583. 'EMAIL' => ['test@example.com'],
  584. 'CLOUD' => ['test@localhost'],
  585. 'isLocalSystemBook' => true,
  586. 'UID' => 'User'
  587. ]
  588. ],
  589. ['emails'=> [], 'exact' => ['emails' => []]],
  590. false,
  591. false,
  592. [
  593. "currentUser" => ["group1"],
  594. "User" => ["group2"]
  595. ]
  596. ],
  597. // The user `User` cannot share with the current user, but there is an exact match on the e-mail address -> share by e-mail
  598. [
  599. 'test@example.com',
  600. [
  601. [
  602. 'FN' => 'User',
  603. 'EMAIL' => ['test@example.com'],
  604. 'CLOUD' => ['test@localhost'],
  605. 'isLocalSystemBook' => true,
  606. 'UID' => 'User'
  607. ]
  608. ],
  609. ['emails' => [], 'exact' => ['emails' => [['label' => 'test@example.com', 'uuid' => 'test@example.com', 'value' => ['shareType' => 4,'shareWith' => 'test@example.com']]]]],
  610. false,
  611. false,
  612. [
  613. "currentUser" => ["group1"],
  614. "User" => ["group2"]
  615. ]
  616. ]
  617. ];
  618. }
  619. }