Skip to content

Commit

Permalink
added dependencies in result array
Browse files Browse the repository at this point in the history
  • Loading branch information
vinodraut committed Sep 22, 2017
1 parent 1ac83ed commit d076b0c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/YesAuthority.php
Original file line number Diff line number Diff line change
Expand Up @@ -866,22 +866,25 @@ public function getZones($requestForUserId = null, $options = [])
if(($getResult->isAccess() === true) and ($getResult->isPublic() === false) and (array_intersect($this->filterTypes, ['all', 'allowed']))) {

$availableZones[] = $this->detailsFormat($getResult, $accessZone, [
'title' => $accessZoneContents['title'],
'is_zone' => true,
'title' => array_get($accessZoneContents, 'title'),
'is_zone' => true,
'dependencies' => array_get($accessZoneContents, 'dependencies'),
]);

} elseif(($getResult->isAccess() === true) and ($getResult->isPublic() === true) and (array_intersect($this->filterTypes, ['all', 'public']))) {

$availableZones[] = $this->detailsFormat($getResult, $accessZone, [
'title' => $accessZoneContents['title'],
'title' => array_get($accessZoneContents, 'title'),
'is_zone' => true,
'dependencies' => array_get($accessZoneContents, 'dependencies'),
]);

} elseif(($getResult->isAccess() === false) and (array_intersect($this->filterTypes, ['all', 'denied']))) {

$availableZones[] = $this->detailsFormat($getResult, $accessZone, [
'title' => $accessZoneContents['title'],
'title' => array_get($accessZoneContents, 'title'),
'is_zone' => true,
'dependencies' => array_get($accessZoneContents, 'dependencies'),
]);
}

Expand Down Expand Up @@ -1014,7 +1017,8 @@ protected function performChecks($initialAccess, $accessIdKey, $accessList, $den
if(is_array($this->dynamicAccessZones) and array_key_exists($accessIdKey, $this->dynamicAccessZones)) {
$this->accessStages[$accessIdKey]['__data'] = [
'is_zone' => true,
'title' => $this->dynamicAccessZones[$accessIdKey]['title']
'title' => array_get($this->dynamicAccessZones[$accessIdKey], 'title'),
'dependencies' => array_get($this->dynamicAccessZones[$accessIdKey], 'dependencies'),
];
}

Expand Down Expand Up @@ -1102,15 +1106,14 @@ protected function detailsFormat($isAccess, $accessIdKey, $options = []) {
'title' => ifIsset($options['title'], true, null),
'is_public' => isset($options['is_public']) ? $options['is_public'] : false,
'is_zone' => ifIsset($options['is_zone'], true),
'dependencies' => ifIsset($options['dependencies'], true, null),
], [
'check_levels' => $this->checkLevels
]);


unset($options, $accessIdKey, $isAccess, $this->accessStages, $resultBy, $parentLevel, $conditionsIfAny, $conditionResult);

return $result;

return $result;
}

/**
Expand Down

0 comments on commit d076b0c

Please sign in to comment.