fix principal access denied and fix test
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -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
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user