diff --git a/src/Controller/AdminPages/BaseAdminController.php b/src/Controller/AdminPages/BaseAdminController.php index 73f56907..0944d59e 100644 --- a/src/Controller/AdminPages/BaseAdminController.php +++ b/src/Controller/AdminPages/BaseAdminController.php @@ -120,7 +120,7 @@ abstract class BaseAdminController extends AbstractController $timeTravel_timestamp = null; if ($timestamp !== null) { $this->denyAccessUnlessGranted('@tools.timeTravel'); - $this->denyAccessUnlessGranted('show_history', $part); + $this->denyAccessUnlessGranted('show_history', $entity); //If the timestamp only contains numbers interpret it as unix timestamp if (ctype_digit($timestamp)) { $timeTravel_timestamp = new \DateTime(); diff --git a/src/EventSubscriber/EventLoggerSubscriber.php b/src/EventSubscriber/EventLoggerSubscriber.php index 34cf3b01..0053f688 100644 --- a/src/EventSubscriber/EventLoggerSubscriber.php +++ b/src/EventSubscriber/EventLoggerSubscriber.php @@ -202,7 +202,8 @@ class EventLoggerSubscriber implements EventSubscriber $this->saveChangeSet($entity, $log, $em); } elseif ($this->save_changed_fields) { $changed_fields = array_keys($uow->getEntityChangeSet($entity)); - unset($changed_fields['lastModified']); + //Remove lastModified field, as this is always changed (gives us no additional info) + $changed_fields = array_diff($changed_fields, ['lastModified']); $log->setChangedFields($changed_fields); } //Add user comment to log entry diff --git a/src/Security/Voter/LogEntryVoter.php b/src/Security/Voter/LogEntryVoter.php index cdc3f1c8..24fe857a 100644 --- a/src/Security/Voter/LogEntryVoter.php +++ b/src/Security/Voter/LogEntryVoter.php @@ -66,6 +66,8 @@ class LogEntryVoter extends ExtendedVoter return $this->resolver->inherit($user, 'system', 'show_logs') ?? false; } + + return false; } protected function supports($attribute, $subject) diff --git a/src/Security/Voter/OrderdetailVoter.php b/src/Security/Voter/OrderdetailVoter.php index d06215f9..f214685e 100644 --- a/src/Security/Voter/OrderdetailVoter.php +++ b/src/Security/Voter/OrderdetailVoter.php @@ -53,5 +53,7 @@ class OrderdetailVoter extends ExtendedVoter $this->resolver->listOperationsForPermission('parts_orderdetails') ), true); } + + return false; } } \ No newline at end of file diff --git a/src/Security/Voter/PartLotVoter.php b/src/Security/Voter/PartLotVoter.php index 6fc372aa..cf022a73 100644 --- a/src/Security/Voter/PartLotVoter.php +++ b/src/Security/Voter/PartLotVoter.php @@ -52,5 +52,7 @@ class PartLotVoter extends ExtendedVoter $this->resolver->listOperationsForPermission('parts_lots') ), true); } + + return false; } } \ No newline at end of file diff --git a/src/Security/Voter/PricedetailVoter.php b/src/Security/Voter/PricedetailVoter.php index 19972fad..e4ec0251 100644 --- a/src/Security/Voter/PricedetailVoter.php +++ b/src/Security/Voter/PricedetailVoter.php @@ -53,5 +53,7 @@ class PricedetailVoter extends ExtendedVoter $this->resolver->listOperationsForPermission('parts_prices') ), true); } + + return false; } } \ No newline at end of file diff --git a/src/Services/LogSystem/EventUndoHelper.php b/src/Services/LogSystem/EventUndoHelper.php index cd0bdb4c..f61171e9 100644 --- a/src/Services/LogSystem/EventUndoHelper.php +++ b/src/Services/LogSystem/EventUndoHelper.php @@ -55,7 +55,7 @@ class EventUndoHelper /** * Set which event log is currently undone. * After the flush this message is cleared. - * @param AbstractLogEntry|null $message + * @param AbstractLogEntry|null $undone_event */ public function setUndoneEvent(?AbstractLogEntry $undone_event): void { @@ -64,7 +64,7 @@ class EventUndoHelper /** * Returns event that is currently undone. - * @return string|null + * @return AbstractLogEntry|null */ public function getUndoneEvent(): ?AbstractLogEntry { diff --git a/tests/Entity/UserSystem/PermissionsEmbedTest.php b/tests/Entity/UserSystem/PermissionsEmbedTest.php index 2c616835..94aee84c 100644 --- a/tests/Entity/UserSystem/PermissionsEmbedTest.php +++ b/tests/Entity/UserSystem/PermissionsEmbedTest.php @@ -137,14 +137,6 @@ class PermissionsEmbedTest extends TestCase $embed->getPermissionValue('parts', 1); } - public function testInvalidBit3(): void - { - $embed = new PermissionsEmbed(); - //When encoutering an too high bit number it must throw an error. - $this->expectException(InvalidArgumentException::class); - $embed->getPermissionValue('parts', 32); - } - public function getStatesBINARY() { return [