Page 1 of 1

PostPosted: Thu Oct 05, 2006 1:25 am
by graeme1950
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

PostPosted: Thu Oct 05, 2006 8:23 am
by shannah
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

PostPosted: Fri Oct 06, 2006 6:58 am
by graeme1950
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

PostPosted: Fri Oct 06, 2006 8:41 am
by shannah
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