- Objects filtering (read) is now performed by the core directly, no need to check further which objects in a set are read-able. Only those that can be read are returned.

SVN:trunk[684]
This commit is contained in:
Denis Flaven
2010-08-23 12:54:27 +00:00
parent 7aacef8d7d
commit a7799e524a
3 changed files with 14 additions and 25 deletions

View File

@@ -676,8 +676,7 @@ try
}
$bIsModifiedAllowed = (UserRights::IsActionAllowed($sClass, UR_ACTION_MODIFY, $oSet) == UR_ALLOWED_YES) && !MetaModel::IsReadOnlyClass($sClass);
$bIsReadAllowed = (UserRights::IsActionAllowed($sClass, UR_ACTION_READ, $oSet) == UR_ALLOWED_YES);
if( ($oObj != null) && ($bIsModifiedAllowed) && ($bIsReadAllowed))
if( ($oObj != null) && $bIsModifiedAllowed )
{
$oP->set_title(Dict::Format('UI:ModificationPageTitle_Object_Class', $oObj->GetName(), $sClassLabel));
$oP->add("<div class=\"page_header\">\n");
@@ -707,14 +706,13 @@ try
$oSearch = new DBObjectSearch($sClass);
$oSearch->AddCondition('id', $id, '=');
$oSet = new CMDBObjectSet($oSearch);
if ($oSet->Count() > 0)
if ($oSet->Count() > 0) // Set is empty if not allowed to read this object
{
$oObjToClone = $oSet->Fetch();
}
$bIsModifiedAllowed = (UserRights::IsActionAllowed($sClass, UR_ACTION_MODIFY, $oSet) == UR_ALLOWED_YES) && !MetaModel::IsReadOnlyClass($sClass);
$bIsReadAllowed = (UserRights::IsActionAllowed($sClass, UR_ACTION_READ, $oSet) == UR_ALLOWED_YES);
if( ($oObjToClone != null) && ($bIsModifiedAllowed) && ($bIsReadAllowed))
if( ($oObjToClone != null) && ($bIsModifiedAllowed))
{
$oP->add_linked_script("../js/json.js");
$oP->add_linked_script("../js/forms-json-utils.js");