Commit a6a7ecfc authored by Marcelo Rivera's avatar Marcelo Rivera

(fix): if entities are provided, don't rehydrate them

1 merge request!349Chore refactor permissions export
Pipeline #86338216 failed with stages
in 4 minutes and 39 seconds
......@@ -40,12 +40,17 @@ class Manager
'entities' => [],
], $opts);
$guids = $opts['guids'] ?: array_map(function ($item) {
return $item->getGuid();
}, $opts['entities']);
if ($opts['user_guid'] === null) {
throw new \InvalidArgumentException('user_guid is required');
}
$user = $this->entitiesBuilder->single($opts['user_guid']);
$entities = $this->entitiesBuilder->get(['guids' => $guids]);
if (!$user) {
throw new \InvalidArgumentException('User does not exist');
}
$entities = $opts['entities'] ?? $this->entitiesBuilder->get(['guids' => $opts['guids']]);
if ($user && $user->getType() !== 'user') {
throw new \InvalidArgumentException('Entity is not a user');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment