Restrict addGrant() to current request only

This commit is contained in:
Kijin Sung 2017-03-02 23:24:28 +09:00
parent e4fe2430d3
commit 9143493f13
6 changed files with 22 additions and 14 deletions

View file

@ -331,7 +331,11 @@ class documentController extends document
*/
function addGrant($document_srl)
{
$_SESSION['own_document'][$document_srl] = true;
$oDocument = getModel('document')->getDocument($document_srl);
if ($oDocument->isExists())
{
$oDocument->setGrant();
}
}
/**

View file

@ -162,7 +162,7 @@ class documentItem extends Object
function isGranted()
{
if ($_SESSION['own_document'][$this->document_srl])
if ($_SESSION['granted_document'][$this->document_srl])
{
return $this->grant_cache = true;
}
@ -203,7 +203,7 @@ class documentItem extends Object
function setGrantForSession()
{
$_SESSION['own_document'][$this->document_srl] = true;
$_SESSION['granted_document'][$this->document_srl] = true;
$this->setGrant();
}

View file

@ -25,7 +25,7 @@ class documentModel extends document
*/
function isGranted($document_srl)
{
return $_SESSION['own_document'][$document_srl];
return $_SESSION['granted_document'][$document_srl];
}
/**