summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-05-18 11:31:41 +0200
committerVincent Petry <pvince81@owncloud.com>2016-05-20 17:56:02 +0200
commit8fbb63d3166378ca63d6d0e6d21fa08d8d8be268 (patch)
treefb244408f51fecdf67f242d7b6d2acfe9873b708
parent66e93561da9cc3c8396552729e7ec9e902c94741 (diff)
downloadnextcloud-server-8fbb63d3166378ca63d6d0e6d21fa08d8d8be268.tar.gz
nextcloud-server-8fbb63d3166378ca63d6d0e6d21fa08d8d8be268.zip
Some tweaks for systemtagmanager
-rw-r--r--lib/private/SystemTag/SystemTagManager.php5
-rw-r--r--lib/public/SystemTag/ISystemTagManager.php2
-rw-r--r--lib/public/UserNotFoundException.php62
3 files changed, 2 insertions, 67 deletions
diff --git a/lib/private/SystemTag/SystemTagManager.php b/lib/private/SystemTag/SystemTagManager.php
index e0bd83603df..2b0ef03e471 100644
--- a/lib/private/SystemTag/SystemTagManager.php
+++ b/lib/private/SystemTag/SystemTagManager.php
@@ -33,7 +33,6 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use OCP\IUserManager;
use OCP\IGroupManager;
use OCP\SystemTag\ISystemTag;
-use OCP\UserNotFoundException;
use OCP\IUser;
/**
@@ -409,8 +408,6 @@ class SystemTagManager implements ISystemTagManager {
$this->connection->rollback();
throw $e;
}
-
- return false;
}
/**
@@ -419,7 +416,7 @@ class SystemTagManager implements ISystemTagManager {
public function getTagGroups(ISystemTag $tag) {
$groupIds = [];
$query = $this->connection->getQueryBuilder();
- $query->select('*')
+ $query->select('gid')
->from(self::TAG_GROUP_TABLE)
->where($query->expr()->eq('systemtagid', $query->createNamedParameter($tag->getId())))
->orderBy('gid');
diff --git a/lib/public/SystemTag/ISystemTagManager.php b/lib/public/SystemTag/ISystemTagManager.php
index a2c61a8dcc2..35447b05fdc 100644
--- a/lib/public/SystemTag/ISystemTagManager.php
+++ b/lib/public/SystemTag/ISystemTagManager.php
@@ -135,7 +135,7 @@ interface ISystemTagManager {
* @param ISystemTag $tag tag to check permission for
* @param IUser $user user to check permission for
*
- * @return true if the user is allowed to assign/unassign the tag, false otherwise
+ * @return true if the user can see the tag, false otherwise
*
* @since 9.1.0
*/
diff --git a/lib/public/UserNotFoundException.php b/lib/public/UserNotFoundException.php
deleted file mode 100644
index b0f9eea0e8a..00000000000
--- a/lib/public/UserNotFoundException.php
+++ /dev/null
@@ -1,62 +0,0 @@
-<?php
-/**
- * @author Vincent Petry <pvince81@owncloud.com>
- *
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-
-namespace OCP;
-
-/**
- * Exception when a user was not found
- *
- * @since 9.1.0
- */
-class UserNotFoundException extends \RuntimeException {
-
- /**
- * User id that was not found
- *
- * @var string
- */
- private $userId;
-
- /**
- * UserNotFoundException constructor.
- *
- * @param string $message message
- * @param int $code error code
- * @param \Exception $previous previous exception
- * @param string $userId user id
- *
- * @since 9.1.0
- */
- public function __construct($message = '', $code = 0, \Exception $previous = null, $userId = null) {
- parent::__construct($message, $code, $previous);
- $this->userId = $userId;
- }
-
- /**
- * Returns the user id that was not found
- *
- * @return string
- * @since 9.1.0
- */
- public function getUserId() {
- return $this->userId;
- }
-}