Skip to content

Commit

Permalink
Merged education accountant and regular accountant functions
Browse files Browse the repository at this point in the history
  • Loading branch information
marekdedic committed Feb 7, 2024
1 parent ea0ca05 commit 7e6004d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ private function assertCanViewBankAccount(int $id): void
if (
$role->getUnitId() === $account->getUnitId()
&& $role->isBasicUnit()
&& ($role->isAccountant() || $role->isOfficer() || $role->isEventManager() || $role->isEducationLeader() || $role->isEducationAccountant())
&& ($role->isAccountant() || $role->isOfficer() || $role->isEventManager() || $role->isEducationLeader())
) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __invoke(EditableUnitsQuery $query): array
{
$role = $query->getRole();

if (! ($role->isLeader() || $role->isAccountant() || $role->isEventManager() || $role->isEducationLeader() || $role->isEducationAccountant())) {
if (! ($role->isLeader() || $role->isAccountant() || $role->isEventManager() || $role->isEducationLeader())) {
return [];
}

Expand Down
7 changes: 1 addition & 6 deletions app/model/User/SkautisRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,14 @@ public function isLeader(): bool

public function isAccountant(): bool
{
return Strings::startsWith($this->key, self::ACCOUNTANT_PREFIX);
return Strings::startsWith($this->key, self::ACCOUNTANT_PREFIX) || $this->key === 'EventEducationEconomist';
}

public function isEducationLeader(): bool
{
return $this->key === 'EventEducationLeader';
}

public function isEducationAccountant(): bool
{
return $this->key === 'EventEducationEconomist';
}

public function isOfficer(): bool
{
return Strings::startsWith($this->key, self::OFFICER_PREFIX);
Expand Down
2 changes: 1 addition & 1 deletion app/model/User/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function getAccessArrays(UnitService $us): array
];
}

if ($role->isLeader() || $role->isAccountant() || $role->isEventManager() || $role->isEducationLeader() || $role->isEducationAccountant()) {
if ($role->isLeader() || $role->isAccountant() || $role->isEventManager() || $role->isEducationLeader()) {
return [
self::ACCESS_READ => $unitIds,
self::ACCESS_EDIT => $unitIds,
Expand Down

0 comments on commit 7e6004d

Please sign in to comment.