mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 03:53:13 +00:00
37 lines
948 B
PHP
37 lines
948 B
PHP
<?php
|
|
/*
|
|
* This file is part of Phraseanet
|
|
*
|
|
* (c) 2005-2015 Alchemy
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
namespace Alchemy\Phrasea\Controller\Prod;
|
|
|
|
use Alchemy\Phrasea\Controller\Controller;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
|
class ShareController extends Controller
|
|
{
|
|
/**
|
|
* Share a record
|
|
*
|
|
* @param integer $base_id
|
|
* @param integer $record_id
|
|
* @return Response
|
|
*/
|
|
public function shareRecord($base_id, $record_id)
|
|
{
|
|
$record = new \record_adapter($this->app, \phrasea::sbasFromBas($this->app, $base_id), $record_id);
|
|
|
|
if (!$this->getAclForUser()->has_access_to_subdef($record, 'preview')) {
|
|
$this->app->abort(403);
|
|
}
|
|
|
|
return $this->renderResponse('prod/Share/record.html.twig', [
|
|
'record' => $record,
|
|
]);
|
|
}
|
|
}
|