@export(Access.DisplayItem)
Set an access control to determine if individual items can be displayed.
$liaison->set('Fresh.Item.Display',
function($item, $table, $id) use ($liaison){
// do your custom code. Maybe look up a user. Maybe just return true for displaying.
return false;
}
);
@TODO Allow bool setting for Fresh.Item.Display, when a callable is not needed.
@TODO MAYBE pass $lia
along to the Fresh.Item.Display handler
@export(Edit.Auto)
Add 'tlf-clicktoedit' to any entity node which you want to have editable.
@export(Edit.Access)
Declare a 'Fresh.Item.Edit' callback.
- Return true to allow, false to not allow
- accept paramaters
$item
,$tableName
, &$itemId
- Will be called for every single item that is loaded via an entity node during a request.
$liaison->set('Fresh.Item.Edit',
function($item, $tableName, $itemId){
// or check that however you want...
if (currently_logged_in_user()->hasAccessTo($item))return true;
return false;
}
);
@export(Edit.HTML)
Call $lia->send('Body_Extra_End_Print')
at the end of your <body>
tag, so the 'Edit Content' button can be displayed.