mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Add getAuthenticator usage
Replace $app['authentication']->getUser() by $app->getAuthenticatedUser() replace twig app['authentication'].getUser() with corresponding method
This commit is contained in:
@@ -57,26 +57,26 @@ class set_selection extends set_abstract
|
||||
$sbas_id = $record->get_sbas_id();
|
||||
$record_id = $record->get_record_id();
|
||||
if (! $rights) {
|
||||
if ($this->app['acl']->get($this->app['authentication']->getUser())->has_hd_grant($record)) {
|
||||
if ($this->app['acl']->get($this->app->getAuthenticatedUser())->has_hd_grant($record)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($this->app['acl']->get($this->app['authentication']->getUser())->has_preview_grant($record)) {
|
||||
if ($this->app['acl']->get($this->app->getAuthenticatedUser())->has_preview_grant($record)) {
|
||||
continue;
|
||||
}
|
||||
if ( ! $this->app['acl']->get($this->app['authentication']->getUser())->has_access_to_base($base_id)) {
|
||||
if ( ! $this->app['acl']->get($this->app->getAuthenticatedUser())->has_access_to_base($base_id)) {
|
||||
$to_remove[] = $id;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
foreach ($rights as $right) {
|
||||
if ( ! $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base($base_id, $right)) {
|
||||
if ( ! $this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_base($base_id, $right)) {
|
||||
$to_remove[] = $id;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
foreach ($sbas_rights as $right) {
|
||||
if ( ! $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_sbas($sbas_id, $right)) {
|
||||
if ( ! $this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_sbas($sbas_id, $right)) {
|
||||
$to_remove[] = $id;
|
||||
continue;
|
||||
}
|
||||
@@ -88,8 +88,8 @@ class set_selection extends set_abstract
|
||||
|
||||
$sql = 'SELECT record_id
|
||||
FROM record
|
||||
WHERE ((status ^ ' . $this->app['acl']->get($this->app['authentication']->getUser())->get_mask_xor($base_id) . ')
|
||||
& ' . $this->app['acl']->get($this->app['authentication']->getUser())->get_mask_and($base_id) . ')=0
|
||||
WHERE ((status ^ ' . $this->app['acl']->get($this->app->getAuthenticatedUser())->get_mask_xor($base_id) . ')
|
||||
& ' . $this->app['acl']->get($this->app->getAuthenticatedUser())->get_mask_and($base_id) . ')=0
|
||||
AND record_id = :record_id';
|
||||
|
||||
$stmt = $connsbas->prepare($sql);
|
||||
|
Reference in New Issue
Block a user