Files
Phraseanet/lib/Alchemy/Phrasea/Controller/Prod/ShareController.php
2015-06-01 10:59:05 +02:00

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,
]);
}
}