Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2020-12-07 15:53:36 +0300
committerVincent Petry <vincent@nextcloud.com>2020-12-11 20:15:51 +0300
commitb7a118ac0c8e0263969e35b55814a7c9f9baddd0 (patch)
tree61775d3b4ae6d58fee386bc45f40d3f5f64791bf /lib/Manager.php
parent506358d4427af8c26bd491a95c1cdae7b3b95e5f (diff)
Check that guests app is enabled when checking
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'lib/Manager.php')
-rw-r--r--lib/Manager.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Manager.php b/lib/Manager.php
index 48667ced8..ffb3f7a35 100644
--- a/lib/Manager.php
+++ b/lib/Manager.php
@@ -31,6 +31,7 @@ use OCA\Talk\Model\Attendee;
use OCA\Talk\Model\AttendeeMapper;
use OCA\Talk\Model\SessionMapper;
use OCA\Talk\Service\ParticipantService;
+use OCP\App\IAppManager;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Comments\IComment;
use OCP\Comments\ICommentsManager;
@@ -56,6 +57,8 @@ class Manager {
private $config;
/** @var Config */
private $talkConfig;
+ /** @var IAppManager */
+ private $appManager;
/** @var AttendeeMapper */
private $attendeeMapper;
/** @var SessionMapper */
@@ -84,6 +87,7 @@ class Manager {
public function __construct(IDBConnection $db,
IConfig $config,
Config $talkConfig,
+ IAppManager $appManager,
AttendeeMapper $attendeeMapper,
SessionMapper $sessionMapper,
ParticipantService $participantService,
@@ -99,6 +103,7 @@ class Manager {
$this->db = $db;
$this->config = $config;
$this->talkConfig = $talkConfig;
+ $this->appManager = $appManager;
$this->attendeeMapper = $attendeeMapper;
$this->sessionMapper = $sessionMapper;
$this->participantService = $participantService;
@@ -1009,7 +1014,10 @@ class Manager {
* @return bool true if the user is a guest, false otherwise
*/
public function isGuestUser(string $userId): bool {
- // FIXME: retrieve guest group name from app ?
+ if (!$this->appManager->isEnabledForUser('guests')) {
+ return false;
+ }
+ // TODO: retrieve guest group name from app once exposed
return $this->groupManager->isInGroup($userId, 'guest_app');
}