Some tweaks for systemtagmanager
This commit is contained in:
parent
66e93561da
commit
8fbb63d316
|
@ -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');
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue