Skip to content

Commit

Permalink
cached item result issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vinodraut committed Jun 8, 2018
1 parent 15100a6 commit 4956505
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/YesAuthority.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ public function check($accessIdKey = null, $requestForUserId = null, array $opti
}
// try to retrive already checked item
$existingUniqueIdItem = config(
$this->uniqueIdKeyString($accessIdKey, $requestForUserId),
$this->uniqueIdKeyString($accessIdKey, $requestForUserId, $options),
null
);
// if found return that same
Expand Down Expand Up @@ -794,7 +794,7 @@ protected function processResult($accessIdKey, $requestForUserId, $accessIdKeyRe
// store the result for later use.
if(is_string($accessIdKey)) {
config([
$this->uniqueIdKeyString($accessIdKey, $requestForUserId) => [
$this->uniqueIdKeyString($accessIdKey, $requestForUserId, $options) => [
'access_id_key' => $accessIdKey,
'result' => $accessIdKeyResult,
]
Expand All @@ -816,11 +816,12 @@ protected function processResult($accessIdKey, $requestForUserId, $accessIdKeyRe
*
* @return mixed
*---------------------------------------------------------------- */
protected function uniqueIdKeyString($accessIdKey, $requestForUserId)
protected function uniqueIdKeyString($accessIdKey, $requestForUserId, $options = [])
{
return strtolower('yes-authority.__authority_permissions.'
.str_replace('.', '_', $accessIdKey)
. '_'
. (($options['internal_details']) ? '_ird_' : '')
.($requestForUserId ?: $this->userId)
. $this->requestCheckStringId);
}
Expand Down

0 comments on commit 4956505

Please sign in to comment.