Customizing or removing the Find tab

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

Customizing or removing the Find tab

Postby ADobkin » Wed Oct 24, 2007 3:39 am

Since the fields visibility tag doesn't apply to the Find in 0.7, is there some other way to customize the fields that display here?

If not, is there a way to just remove the Find tab altogether without removing the other tabs? In other words, setting 'show_table_tabs'=>0 in getPreferences() removes too much functionality. I do want the ability to create new records and switch to list view, but I don't want to display all the fields in the table.

Thanks,
Alan
ADobkin
 
Posts: 195
Joined: Mon Oct 22, 2007 7:31 pm
Location: Atlanta, GA, USA

Postby shannah » Wed Oct 24, 2007 7:59 am

In your actions.ini file you can override the find action.

Code: Select all
[find]


This overrides the find action with a blank action, so that I won't be displayed anymore.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby ADobkin » Wed Oct 24, 2007 8:12 am

That's perfect, thanks. I hadn't created an actions.ini file yet.

Now my next question is, can this be tied to permissions, so certain users (especially admin) can still use the find tab?
ADobkin
 
Posts: 195
Joined: Mon Oct 22, 2007 7:31 pm
Location: Atlanta, GA, USA

Postby shannah » Wed Oct 24, 2007 9:17 am

For this you would take a different approach (i.e. undo the change to the actions.ini file).

If you look in the dataface actions.ini file you can see the full definition of the find action. I believe that the permission for this action is called 'find' also. When you are defining your getPermissions(&$record) methods in your delegate class just make sure that admins have the 'find' permission and others do not.

One convenient way to do that is to define some custom roles in your permissions.ini file with the permissions that you want.

e.g.:

Code: Select all
[REGULAR USER extends READ ONLY]
    find=0


Then in your getPermissions() method:
Code: Select all
function getPermissions(&$record){
    if ( is regular user ){
        return Dataface_PermissionsTool::getRolePermissions('REGULAR USER');
    } else if ( is admin ){
        return Dataface_PermissionsTool::ALL();
    } else {
        return Dataface_PermissionsTool::NO_ACCESS();
    }
}


or something like that.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby ADobkin » Wed Oct 24, 2007 12:26 pm

Thanks, that was exactly what I was looking for!
ADobkin
 
Posts: 195
Joined: Mon Oct 22, 2007 7:31 pm
Location: Atlanta, GA, USA


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 16 guests

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