Hide history tabs in an application ...

A place for users and developers of the Xataface to discuss and receive support.

Hide history tabs in an application ...

Postby 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
 
Posts: 19
Joined: Tue Sep 01, 2009 6:18 am

Re: Hide history tabs in an application ...

Postby 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
zabelle_motte
 
Posts: 19
Joined: Tue Sep 01, 2009 6:18 am

Re: Hide history tabs in an application ...

Postby 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
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Hide history tabs in an application ...

Postby 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
zabelle_motte
 
Posts: 19
Joined: Tue Sep 01, 2009 6:18 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved