Example #1
0
 static function CheckRights($id)
 {
     $id = intval($id);
     if ($id > 0) {
         $dbWDFile = CIBlockElement::GetList(array(), array('ID' => $id), false, false, array('IBLOCK_ID'));
         if ($dbWDFile && ($arWDFile = $dbWDFile->Fetch())) {
             $iBlockID = intval($arWDFile['IBLOCK_ID']);
             $resT = CWebDavIblock::CheckUserIBlockPermission("element_read", CWebDavIblock::OBJ_TYPE_ELEMENT, $iBlockID, $id);
             if ($resT) {
                 return true;
             }
         } else {
             //non exists
             return null;
         }
     }
     return false;
 }