Code Duplication    Length = 7-9 lines in 4 locations

apps/dav/lib/SystemTag/SystemTagsByIdCollection.php 1 location

@@ 77-83 (lines=7) @@
74
	 *
75
	 * @return bool true if the user is an admin
76
	 */
77
	private function isAdmin() {
78
		$user = $this->userSession->getUser();
79
		if ($user !== null) {
80
			return $this->groupManager->isAdmin($user->getUID());
81
		}
82
		return false;
83
	}
84
85
	/**
86
	 * @param string $name

apps/dav/lib/Connector/Sabre/FilesReportPlugin.php 1 location

@@ 395-401 (lines=7) @@
392
	/**
393
	 * Returns whether the currently logged in user is an administrator
394
	 */
395
	private function isAdmin() {
396
		$user = $this->userSession->getUser();
397
		if ($user !== null) {
398
			return $this->groupManager->isAdmin($user->getUID());
399
		}
400
		return false;
401
	}
402
}
403

apps/updatenotification/lib/Notification/Notifier.php 1 location

@@ 155-163 (lines=9) @@
152
	/**
153
	 * @return bool
154
	 */
155
	protected function isAdmin() {
156
		$user = $this->userSession->getUser();
157
158
		if ($user instanceof IUser) {
159
			return $this->groupManager->isAdmin($user->getUID());
160
		}
161
162
		return false;
163
	}
164
165
	protected function getCoreVersions() {
166
		return implode('.', \OCP\Util::getVersion());

lib/private/NavigationManager.php 1 location

@@ 278-284 (lines=7) @@
275
		}
276
	}
277
278
	private function isAdmin() {
279
		$user = $this->userSession->getUser();
280
		if ($user !== null) {
281
			return $this->groupManager->isAdmin($user->getUID());
282
		}
283
		return false;
284
	}
285
286
	private function isSubadmin() {
287
		$user = $this->userSession->getUser();