Defining existing actions

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

Postby graeme1950 » Thu Oct 05, 2006 1:25 am

I'm a newbie, and just set up dataface for the first time ~ excellent product! I can see it saves ne a lot of work setting up a 'front-end' for users, however I've read the section on getting started and particulalry the section on actions.ini

My question is ~ how do I remove the 'delete' onption in the standard action script? In particular want to stop a user from droppping the whole recordset or deleting a found set.

Thanks
Graeme Hird
graeme1950
 
Posts: 14
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Thu Oct 05, 2006 8:23 am

The best way to do this is with permissions.

There are a couple of ways to do this. One way would be to assign the EDIT role to your users.

Steps;

1. Add an application delegate class by creating a 'conf' directory in your application's directory, and adding a file named 'ApplicationDelegate.php' to this folder with the following contents:

Code: Select all
class conf_ApplicationDelegate {

    function getPermissions(&$record){
        return Dataface_PermissionsTool::getRolePermissions('EDIT');
    }
}

?>


The EDIT role can do everything except delete. (see http://dataface.weblite.ca/getRolePermissions for information about the getRolePermissions method).

You can take a look at the permissions.ini file to see what other roles there are. You can also create a permissions.ini file in your application's directory to create your own roles.

Hope this helps.

-Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby graeme1950 » Fri Oct 06, 2006 6:58 am

Thank you, I hadn't seen the permisions.ini file ~ I've initially used the conf directory option, it works perfectly and now I understand the permissions file I can use either to suit my needs.

Best regards
Graeme
graeme1950
 
Posts: 14
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Fri Oct 06, 2006 8:41 am

Note that if you want to use the permissions.ini file to define roles, don't modify the one in the dataface directory. If you create a permissions.ini file in your application folder, its permissions will be merged with those in the dataface directory to override the permissions.

Best regards

Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 1 guest

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