allowed to add new relative records

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

allowed to add new relative records

Postby fantomasdm » Fri Jul 18, 2008 12:38 pm

Is possible to add new relative records when permission on parent record is Dataface_PermissionsTool::READ_ONLY()?
fantomasdm
 
Posts: 114
Joined: Thu Mar 13, 2008 2:35 pm

Postby shannah » Mon Jul 21, 2008 6:43 pm

The READ_ONLY role does not allow adding new related records, but this doesn't mean that you can't explicitly allow your user to add new related records.

The easiest (but not necessarily best) way to handle this is just to add the 'add new related record' permission in your getPermissions() method. But beware that this will enable the user to add related records to all relationships of this record.

e.g.

Code: Select all
function getPermissions(&$record){
    $perms = Dataface_PermissionsTool::READ_ONLY();
    $perms['add new related record'] = 1;
    return $perms;
}


(Check the dataface permissions.ini file to see what permissions are available and which roles have which permissions).

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby fantomasdm » Tue Jul 22, 2008 7:15 am

Thanks!! Is what I need!!
fantomasdm
 
Posts: 114
Joined: Thu Mar 13, 2008 2:35 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 31 guests

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