Skip to content

Commit

Permalink
Prep work for Hierarchical Secuity and some QOL updates and fix bug D…
Browse files Browse the repository at this point in the history
…epartment Officer Roster options extend past container Ansteorra#361
  • Loading branch information
jhandel committed Mar 1, 2025
1 parent b63c65e commit 41016f9
Show file tree
Hide file tree
Showing 94 changed files with 1,639 additions and 1,056 deletions.
45 changes: 45 additions & 0 deletions app/config/Migrations/20250227173909_AddScopeToMemberRoles.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

declare(strict_types=1);

use Migrations\BaseMigration;

class AddScopeToMemberRoles extends BaseMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/4/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('member_roles');
$table->addColumn("branch_id", "integer", [
"default" => null,
"limit" => 11,
"null" => true,
])
->update();

$table = $this->table('member_roles');
$table->addForeignKey("branch_id", "branches", "id", [
"update" => "NO_ACTION",
"delete" => "NO_ACTION",
])
->update();

$table = $this->table('permissions');
$table->addColumn("scoping_rule", "string", [
"default" => "Global",
"limit" => 255,
"null" => false,
])
->update();

//update existing permissions to have no scoping
$this->execute("UPDATE permissions SET scoping_rule = 'Global'");
$table = $this->table('permissions');
}
}
22 changes: 22 additions & 0 deletions app/config/Migrations/20250227230531_AddDomainToBranch.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

use Migrations\BaseMigration;

class AddDomainToBranch extends BaseMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/4/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('branches');
$table->addColumn('domain', 'string', ['default' => '', 'limit' => 255, 'null' => false]);
$table->update();
}
}
Binary file modified app/config/Migrations/schema-dump-default.lock
Binary file not shown.
22 changes: 11 additions & 11 deletions app/config/Seeds/DevLoadActivitiesSeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function run(): void
[
'id' => 1,
'name' => 'Armored Combat',
'term_length' => 4,
'term_length' => 48,
'activity_group_id' => 1,
'grants_role_id' => NULL,
'minimum_age' => 16,
Expand All @@ -41,7 +41,7 @@ public function run(): void
[
'id' => 2,
'name' => 'Armored Combat Field Marshal',
'term_length' => 4,
'term_length' => 48,
'activity_group_id' => 1,
'grants_role_id' => NULL,
'minimum_age' => 16,
Expand All @@ -56,7 +56,7 @@ public function run(): void
[
'id' => 3,
'name' => 'Rapier Combat',
'term_length' => 4,
'term_length' => 48,
'activity_group_id' => 2,
'grants_role_id' => NULL,
'minimum_age' => 16,
Expand All @@ -71,7 +71,7 @@ public function run(): void
[
'id' => 4,
'name' => 'Rapier Combat Field Marshal',
'term_length' => 4,
'term_length' => 48,
'activity_group_id' => 2,
'grants_role_id' => NULL,
'minimum_age' => 16,
Expand All @@ -86,7 +86,7 @@ public function run(): void
[
'id' => 5,
'name' => 'Youth Boffer 1',
'term_length' => 4,
'term_length' => 48,
'activity_group_id' => 3,
'grants_role_id' => NULL,
'minimum_age' => 6,
Expand All @@ -101,7 +101,7 @@ public function run(): void
[
'id' => 6,
'name' => 'Youth Boffer 2',
'term_length' => 4,
'term_length' => 48,
'activity_group_id' => 3,
'grants_role_id' => NULL,
'minimum_age' => 10,
Expand All @@ -116,7 +116,7 @@ public function run(): void
[
'id' => 7,
'name' => 'Youth Boffer 3',
'term_length' => 4,
'term_length' => 48,
'activity_group_id' => 3,
'grants_role_id' => NULL,
'minimum_age' => 13,
Expand All @@ -131,7 +131,7 @@ public function run(): void
[
'id' => 8,
'name' => 'Youth Boffer Marshal',
'term_length' => 4,
'term_length' => 48,
'activity_group_id' => 3,
'grants_role_id' => NULL,
'minimum_age' => 16,
Expand All @@ -146,7 +146,7 @@ public function run(): void
[
'id' => 9,
'name' => 'Youth Boffer Junior Marshal',
'term_length' => 4,
'term_length' => 48,
'activity_group_id' => 3,
'grants_role_id' => NULL,
'minimum_age' => 12,
Expand All @@ -161,7 +161,7 @@ public function run(): void
[
'id' => 10,
'name' => 'Authorizing Rapier Marshal',
'term_length' => 2,
'term_length' => 24,
'activity_group_id' => 2,
'grants_role_id' => 204,
'minimum_age' => 18,
Expand All @@ -178,4 +178,4 @@ public function run(): void
$table = $this->table('activities_activities');
$table->insert($data)->save();
}
}
}
Loading

0 comments on commit 41016f9

Please sign in to comment.