mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
fix right access and right on story elements per user
This commit is contained in:
@@ -1735,7 +1735,9 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
||||
throw new Exception('This record is not a grouping');
|
||||
}
|
||||
|
||||
$selections = $this->getDatabox()->getRecordRepository()->findChildren([$this->getRecordId()], null, $offset, $max_items);
|
||||
$user = $this->getAuthenticatedUser();
|
||||
|
||||
$selections = $this->getDatabox()->getRecordRepository()->findChildren([$this->getRecordId()], $user, $offset, $max_items);
|
||||
|
||||
return reset($selections);
|
||||
}
|
||||
@@ -1745,7 +1747,9 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
||||
*/
|
||||
public function get_grouping_parents()
|
||||
{
|
||||
$selections = $this->getDatabox()->getRecordRepository()->findParents([$this->getRecordId()]);
|
||||
$user = $this->getAuthenticatedUser();
|
||||
|
||||
$selections = $this->getDatabox()->getRecordRepository()->findParents([$this->getRecordId()], $user);
|
||||
|
||||
return reset($selections);
|
||||
}
|
||||
@@ -1948,4 +1952,15 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
||||
{
|
||||
return $this->app['provider.repo.media_subdef']->getRepositoryForDatabox($this->getDataboxId());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return User|null
|
||||
*/
|
||||
protected function getAuthenticatedUser()
|
||||
{
|
||||
/** @var \Alchemy\Phrasea\Authentication\Authenticator $authenticator */
|
||||
$authenticator = $this->app['authentication'];
|
||||
|
||||
return $authenticator->getUser();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user