From 48721c85ebcfa973ee81719d2467ca80e4253dc9 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Fri, 01 May 2026 17:30:03 +0000
Subject: [PATCH] =Edmonton Ink hard test begins! Real testing of the managers and reset routes will commence. So far, just ensuring our classes are all loaded correctly: Site() and its sub-classes Membership, Login, etc. Care should be taken to load conditionally on 'init', as we finish defining most settings by 'plugins_loaded' at priority 5
---
JVBase.php | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/JVBase.php b/JVBase.php
index cf531ec..4c0bac8 100644
--- a/JVBase.php
+++ b/JVBase.php
@@ -3,8 +3,10 @@
use JVBase\blocks\CustomBlocks;
use JVBase\base\Site;
+use JVBase\managers\ApprovalManager;
use JVBase\managers\EmailManager;
use JVBase\managers\ErrorHandler;
+use JVBase\managers\FavouritesManager;
use JVBase\managers\InvitationsManager;
use JVBase\managers\LoginManager;
use JVBase\managers\MagicLinkManager;
@@ -149,6 +151,9 @@
$this->managers['notifications'] = new NotificationManager();
$this->routes['notifications'] = new NotificationsRoutes();
}
+ if (!empty(Registrar::getFeatured('approve_new'))) {
+ $this->managers['approvals'] = new ApprovalManager();
+ }
if (Site::has('feed_block') || Site::has('dashboard')) {
$this->routes['term'] = new TermRoutes();
}
@@ -168,6 +173,7 @@
}
if (Site::has('favourites')) {
+ $this->managers['favourites'] = new FavouritesManager();
$this->routes['favourites'] = new FavouritesRoutes();
}
@@ -296,8 +302,9 @@
public function userCanConnect(string $service, int $userID): bool
{
- $allowed = JVB_USER[jvbUserRole($userID)]['integrations'] ?? [];
- return user_can($userID, 'manage_options') || in_array($service, $allowed);
+ $role = jvbUserRole($userID);
+ $registrar = Registrar::getInstance($role);
+ return user_can($userID, 'manage_options') || $registrar->hasIntegration($service);
}
public function getAvailableServices(bool $keys = true): array
@@ -388,4 +395,9 @@
{
return $this->managers['terms'];
}
+
+ public function approvals ():ApprovalManager|false
+ {
+ return $this->managers['approvals']??false;
+ }
}
--
Gitblit v1.10.0