[TYPO3-core] RFC #13576, 13577, 13578: Add Hooks in order to restrict permissions for individual content elements

Matthias Ewert matthias.ewert at denkwerk.com
Wed Mar 3 11:33:29 CET 2010


Hey Benni,

thank you very much for your answer :)

I modified my hooks like you described and optimized my extension. I'm 
now also sending you the hooks for the page module, hope you can have a 
look at them. I created a patch file which I attached.

So however, I now have the following hooks:

1. tcemain hook:
	//Hook for filtering data
	//Hook for filtering commands
	
Besides 'edit' and 'delete, my extension now also restrict the functions 
'hide', 'moveup/movedown', 'copy', 'cut'.

Therefore I easyly filter the incoming command and data array and delete 
commands which are restricted for the individual user. I wasnt sure if I 
should combine these hooks and make an array of $cmd and $data or if I 
should divide them properly.

2. clickmenu hook:
	//Hook for disabling Items in Click Menu
I reviewed this hook and I can disbale all necessary items from the 
Click Menu without this hook except the hide item? This item is 
apparently processed after basic items and havent found a way yet to 
disable it with the processingByExtClassArray function. The other idea 
is to build a hook which processes the whole menuitems array before it 
is print out. This would be more general and every extension developer 
could disable any items from the menu. What do you think?!

3. alt_doc hook:
	//Hook for pre-editing $SOBE

I've changed this hook like you said and tested it, works fine!

4. class.tx_cms_layout hooks (page module)

The following five hooks are for hiding the icons, like the edit pen or 
the delete garbage. Do you see an easier way to hide these icons 
individually? I know that these are many hooks, but it could be a nice 
feature for other extensions as well.

Thank you very much for you help again!

I'm looking forward to hearing from you!

Best, Matthias.




Benjamin Mack schrieb:
> Hey Matthias,
> 
> nice to see you on this list :)
> 
> 1. tcemain hook:
> 
>  > $hookObj = t3lib_div..
> 
> no need to return the $hookObj, this should suffice:
> 
>  > t3lib_div::callUserFunction($classRef, $delRec, $this);
> 
> 2. clickmenu hook:
> 
> a) like above, no need to return $hookObj
> 
> b) please make an associative array out of the $_params, like this:
> 
> $_params = array(
>     'uid' => $uid,
>     'table' => $table,
>     'disabledItems' => &$this->disabledItems
> );
> 
> Also, I'm not sure if we need this. Can't we do this with the method 
> "processingByExtClassArray()" ? You should be able to create your own 
> Ext that has the clickmenu object as parameter, which you can modify the 
> disabledItems patch with. Right?
> 
> So, you could probably solve this issue with another way than adding a 
> hook in alt_clickmenu.php.
> 
> 3. alt_doc hook.
> 
> a) like above, $hookObj
> 
> b) I don't think the hook should be in this place. I think it should 
> rather be in the preInit() method in the very end. You could then send 
> the alt_doc object as parameter and modify its  $this->editconf to 
> remove the items that are not allowed to be edited. That should suffice 
> as well, right?
> 
> 
> All the best,
> Benni.


More information about the TYPO3-team-core mailing list