#415 Could not limit user on some organization (symptom: wrong queries... org_id does not exist...)

SVN:trunk[1319]
This commit is contained in:
Romain Quetiez
2011-07-01 15:08:38 +00:00
parent b2c5f183ec
commit 645b02b2d1
3 changed files with 15 additions and 6 deletions

View File

@@ -751,17 +751,24 @@ exit;
// Determine how to position the objects of this class
//
$aCallSpec = array($sClass, 'MapContextParam');
if ($sClass == 'Organization')
{
$sAttCode = 'id';
}
elseif (is_callable("$sClass::MapContextParam"))
elseif (is_callable($aCallSpec))
{
$sAttCode = eval("return $sClass::MapContextParam('org_id');"); // Returns null when there is no mapping for this parameter
$sAttCode = call_user_func($aCallSpec, 'org_id'); // Returns null when there is no mapping for this parameter
if ($sAttCode == null)
{
return true;
}
if (!MetaModel::IsValidAttCode($sClass, $sAttCode))
{
// Skip silently. The data model checker will tell you something about this...
return true;
}
}
elseif(MetaModel::IsValidAttCode($sClass, 'org_id'))
{