fix principal access denied and fix test
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 48s
Tests / PHPUnit (push) Successful in 1m20s

This commit is contained in:
root
2026-08-28 00:26:44 -04:00
parent 38644b32ae
commit 3133b3c584
4 changed files with 36319 additions and 2 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -854,7 +854,7 @@ $routes->group('api/time', ['namespace' => 'App\Controllers\Api'], static functi
* routes for View\SchoolCalendarController * routes for View\SchoolCalendarController
* -------------------------------------------------------------------- * --------------------------------------------------------------------
*/ */
$routes->group('administrator', ['namespace' => 'App\Controllers', 'filter' => 'auth:admin'], function ($routes) { $routes->group('administrator', ['namespace' => 'App\Controllers', 'filter' => 'auth:admin|administrator|principal|vice_principal|vice principal'], function ($routes) {
$routes->get('calendar_view', 'View\SchoolCalendarController::index'); $routes->get('calendar_view', 'View\SchoolCalendarController::index');
$routes->get('calendar_edit/(:num)', 'View\SchoolCalendarController::edit/$1'); $routes->get('calendar_edit/(:num)', 'View\SchoolCalendarController::edit/$1');
$routes->get('calendar_delete/(:num)', 'View\SchoolCalendarController::delete/$1'); $routes->get('calendar_delete/(:num)', 'View\SchoolCalendarController::delete/$1');
@@ -9,7 +9,7 @@ final class EnrollmentEligibility
public const DEFERRED_MESSAGE = 'Re-enrollment cannot currently be completed because the final deliberation decision is deferred. Please contact the school administration for the next required step.'; public const DEFERRED_MESSAGE = 'Re-enrollment cannot currently be completed because the final deliberation decision is deferred. Please contact the school administration for the next required step.';
public const KG_MISSING_DECISION_ELIGIBLE_MESSAGE = 'KG students may complete registration now. Their new-year grade placement will be based on the school age-placement rule.'; public const KG_MISSING_DECISION_ELIGIBLE_MESSAGE = 'KG students may complete registration now. Their new-year grade placement will be based on the school age-placement rule.';
public const MISSING_DECISION_MESSAGE = 'Re-enrollment cannot currently be completed because no final deliberation decision is recorded for the student. Registration will become available after the school records a final decision.'; public const MISSING_DECISION_MESSAGE = 'Re-enrollment cannot currently be completed because no final deliberation decision is recorded for the student. Registration will become available after the school records a final decision.';
public const ADULT_STUDENT_MESSAGE = 'This student will be 18 years old or older on September 1 of the selected school year. This student can no longer enroll with the school'; public const ADULT_STUDENT_MESSAGE = 'This student will be 18 years old or older on September 1 of the selected school year. A parent or guardian cannot complete registration for this student. Please contact school administration.';
public const ADULT_STUDENT_PARENT_PORTAL_MESSAGE = self::ADULT_STUDENT_MESSAGE; public const ADULT_STUDENT_PARENT_PORTAL_MESSAGE = self::ADULT_STUDENT_MESSAGE;
public const WITHDRAWN_PORTAL_MESSAGE = 'This student is currently marked as Withdrawn and cannot be enrolled at this time. Please contact school administration.'; public const WITHDRAWN_PORTAL_MESSAGE = 'This student is currently marked as Withdrawn and cannot be enrolled at this time. Please contact school administration.';
public const SIBLING_PORTAL_MESSAGE = 'Enrollment cannot continue because the family record requires administrative review. Please contact school administration.'; public const SIBLING_PORTAL_MESSAGE = 'Enrollment cannot continue because the family record requires administrative review. Please contact school administration.';
@@ -0,0 +1,18 @@
<?php
namespace Tests\App\Config;
use CodeIgniter\Test\CIUnitTestCase;
final class SchoolCalendarRouteIntegrityTest extends CIUnitTestCase
{
public function testSchoolCalendarRoutesAllowPrincipalRole(): void
{
$routes = file_get_contents(ROOTPATH . 'app/Config/Routes.php') ?: '';
$this->assertStringContainsString(
"\$routes->group('administrator', ['namespace' => 'App\\Controllers', 'filter' => 'auth:admin|administrator|principal|vice_principal|vice principal'], function (\$routes) {\n \$routes->get('calendar_view'",
$routes
);
}
}