Skip to content

Commit

Permalink
different logging for restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
narcoticfresh committed Mar 22, 2024
1 parent eb3af66 commit 0c24aad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/Graviton/RestBundle/Listener/RestrictionListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ public function onPreAggregate(PreAggregateEvent $event)

$matchConditions = [];
$projectStage = [];
$dataRestrictions = $this->securityUtils->getRequestDataRestrictions();

foreach ($this->securityUtils->getRequestDataRestrictions() as $fieldName => $fieldValue) {
foreach ($dataRestrictions as $fieldName => $fieldValue) {
$projectStage[$fieldName] = 0;
if (is_null($fieldValue)) {
continue;
Expand Down Expand Up @@ -201,8 +202,9 @@ public function onPreAggregate(PreAggregateEvent $event)
$this->logger->info(
'RESTRICTION onPreAggregate',
[
'pipeline' => $newPipeline,
'mode' => $this->securityUtils->getDataRestrictionMode()
'mode' => $this->securityUtils->getDataRestrictionMode(),
'values' => $dataRestrictions,
'pipeline' => $newPipeline
]
);

Expand Down
2 changes: 1 addition & 1 deletion src/Graviton/SecurityBundle/Service/SecurityUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public function getRequestDataRestrictions()
if (!is_null($headerValue) && $fieldSpec['type'] == 'int') {
$headerValue = (int) $headerValue;
}
$restrictions[$fieldSpec['name']] = $headerValue;
$restrictions[$fieldSpec['name']] = (string) $headerValue;
}
return $restrictions;
}
Expand Down

0 comments on commit 0c24aad

Please sign in to comment.