Completed
Push — some-scrutinizing ( b2f84c...29b6ab )
by Maxence
23:41
created

NavigationController::navigate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 22
rs 9.2
c 1
b 0
f 0
cc 1
eloc 13
nc 1
nop 0
1
<?php
2
/**
3
 * Circles - Bring cloud-users closer together.
4
 *
5
 * This file is licensed under the Affero General Public License version 3 or
6
 * later. See the COPYING file.
7
 *
8
 * @author Maxence Lange <[email protected]>
9
 * @copyright 2017
10
 * @license GNU AGPL version 3 or any later version
11
 *
12
 * This program is free software: you can redistribute it and/or modify
13
 * it under the terms of the GNU Affero General Public License as
14
 * published by the Free Software Foundation, either version 3 of the
15
 * License, or (at your option) any later version.
16
 *
17
 * This program is distributed in the hope that it will be useful,
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 * GNU Affero General Public License for more details.
21
 *
22
 * You should have received a copy of the GNU Affero General Public License
23
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
24
 *
25
 */
26
27
namespace OCA\Circles\Controller;
28
29
use \OCA\Circles\Model\Circle;
30
use OCP\AppFramework\Http\TemplateResponse;
31
32
class NavigationController extends BaseController {
33
34
35
	/**
36
	 * @NoCSRFRequired
37
	 * @NoAdminRequired
38
	 * @NoSubAdminRequired
39
	 *
40
	 * @return TemplateResponse
41
	 */
42
	public function navigate() {
43
		$data = [
44
			'allowed_circles' => array(
45
				Circle::CIRCLES_PERSONAL => $this->configService->isCircleAllowed(
46
					Circle::CIRCLES_PERSONAL
47
				),
48
				Circle::CIRCLES_HIDDEN   => $this->configService->isCircleAllowed(
49
					Circle::CIRCLES_HIDDEN
50
				),
51
				Circle::CIRCLES_PRIVATE  => $this->configService->isCircleAllowed(
52
					Circle::CIRCLES_PRIVATE
53
				),
54
				Circle::CIRCLES_PUBLIC   => $this->configService->isCircleAllowed(
55
					Circle::CIRCLES_PUBLIC
56
				),
57
			)
58
		];
59
60
		return new TemplateResponse(
61
			'circles', 'navigate', $data
62
		);
63
	}
64
65
66
}