mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-21 00:02:17 +02:00
N°985 - Add applicable contexts on Trigger
This commit is contained in:
@@ -23,7 +23,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
require_once MODULESROOT.'itop-portal-base/portal/config/bootstrap.php';
|
||||
|
||||
// Stacking context tag so it knows we are in the portal
|
||||
$oContext = new ContextTag('GUI:Portal');
|
||||
$oContext = new ContextTag(ContextTag::TAG_PORTAL);
|
||||
$oContext2 = new ContextTag('Portal:' . $_ENV['PORTAL_ID']);
|
||||
|
||||
// Note: Manually refactored ternary condition to be PHP 5.x compatible
|
||||
|
||||
@@ -100,7 +100,7 @@ abstract class AbstractPortalUrlMaker implements iDBObjectURLMaker
|
||||
switch ($sMode)
|
||||
{
|
||||
case 'view':
|
||||
if (!ContextTag::Check('GUI:Portal') || $oSecurityHelper->IsActionAllowed(UR_ACTION_READ, $sClass, $iId))
|
||||
if (!ContextTag::Check(ContextTag::TAG_PORTAL) || $oSecurityHelper->IsActionAllowed(UR_ACTION_READ, $sClass, $iId))
|
||||
{
|
||||
$sObjectQueryString = $oUrlGenerator->generate('p_object_view', array('sObjectClass' => $sClass, 'sObjectId' => $iId));
|
||||
}
|
||||
@@ -109,11 +109,11 @@ abstract class AbstractPortalUrlMaker implements iDBObjectURLMaker
|
||||
case 'edit':
|
||||
default:
|
||||
// Checking if user is allowed to edit object, if not we check if it can at least view it.
|
||||
if (!ContextTag::Check('GUI:Portal') || $oSecurityHelper->IsActionAllowed(UR_ACTION_MODIFY, $sClass, $iId))
|
||||
if (!ContextTag::Check(ContextTag::TAG_PORTAL) || $oSecurityHelper->IsActionAllowed(UR_ACTION_MODIFY, $sClass, $iId))
|
||||
{
|
||||
$sObjectQueryString = $oUrlGenerator->generate('p_object_edit', array('sObjectClass' => $sClass, 'sObjectId' => $iId));
|
||||
}
|
||||
elseif (!ContextTag::Check('GUI:Portal') || $oSecurityHelper->IsActionAllowed(UR_ACTION_READ, $sClass, $iId))
|
||||
elseif (!ContextTag::Check(ContextTag::TAG_PORTAL) || $oSecurityHelper->IsActionAllowed(UR_ACTION_READ, $sClass, $iId))
|
||||
{
|
||||
$sObjectQueryString = $oUrlGenerator->generate('p_object_view', array('sObjectClass' => $sClass, 'sObjectId' => $iId));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user