Hide history tabs in an application …
Archived from the Xataface Users forum.
zabelle_motte — Tue May 15, 2012 2:17 am
Hello !
I wanna know if it is possible to hide the history tabs in an application for some users while enabling history logs.
I have been searching the documentation and forums without success.
Thanks in advance.
Zabelle
zabelle_motte — Mon May 21, 2012 2:25 am
Hello again !
I have been scratching my head for some days, and it seems finally simple !
Add these lines int the actions.ini file :
- Code: Select all
[history] visible=0
Simple but tricky.
Perhaps nice to add a section “How to hide history tabs” in the documentation page :
http://xataface.com/documentation/how-to/history-howto
Zabelle
shannah — Mon May 21, 2012 9:33 am
The history tabs are actually just manifestations of the “history” action. Its definition in the actions.ini file is as follows:
- Code: Select all
[history] url = "{$this->url('-action=history')}" template = Dataface_Record_History.html mode = browse category = record_tabs selected_condition = "$query['-action'] == 'history'" condition = "is_array($this->_conf['history'])" permission = history order=4
This gives a clue as to how to hide the tabs. The best way would be to disallow the “history” permission from users that shouldn’t have access to it. Another way is to override the history action in your own actions.ini file and override the condition directive to include other conditions. Alternatively you could override the action and change the category so that it doesn’t appear in the record actions.
I repeat though, the best way is with permissions. That way you prevent users from accessing history altogether, even if they know the URL directly.
-Steve
zabelle_motte — Tue May 22, 2012 12:37 am
Thank you very much for your suggestion !
Permissions seems to be a much more secure way to disable history.
Great application,
Zabelle