[TYPO3-dev] Access control for content element in user group level

tapio tapio.markula at dnainternet.net
Thu Mar 9 22:35:55 CET 2006


Hi

I got in a way for content access for content elements in user level.
I would include that into my plugin.

I just would like to check certain issues.

Could these cause in some situation problems:

in XCLASS for alt_doc.php

$trData = t3lib_div::makeInstance('t3lib_transferData');		 
$trData->fetchRecord($table,$theUid,$cmd=='new'?'new':'');
reset($trData->regTableItems_data);
$rec = current($trData->regTableItems_data);


in XCLASS for db_layout.php

$trData->lockRecords=1;		 
$trData->fetchRecord($eRParts[0],($uidVal=='new'?$this->id:$uidVal),$uidVal); 


// Getting/Making the record:
reset($trData->regTableItems_data);
$rec = current($trData->regTableItems_data);

These relates with the data, which is in the database.
Could the fetchRecord() cause problems in some situations
when doing following
										

// makes an array from user groups, which can access the content element
$recordData = 
t3lib_div::trimExplode(',',$rec['tx_tm_contentaccess_user_group'],1);
$recordData = array($recordData);						$count=count($recordData[0]);

// makes an array from user groups, which the BE user belongs to	 
$userData = t3lib_div::trimExplode(',',$BE_USER->user['usergroup'],1);
$userData = array($userData);
$userDataCount=count($userData);
	}
										if($hasAccess && $count>0) or if($recordAccess && $count>0)


They compare user groups. Comparisons have been doen only in situations, 
when for a content element has been set allowed user groups.


...




More information about the TYPO3-dev mailing list