Page 1 of 1

allowed to add new relative records

PostPosted: Fri Jul 18, 2008 12:38 pm
by fantomasdm
Is possible to add new relative records when permission on parent record is Dataface_PermissionsTool::READ_ONLY()?

PostPosted: Mon Jul 21, 2008 6:43 pm
by shannah
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

PostPosted: Tue Jul 22, 2008 7:15 am
by fantomasdm
Thanks!! Is what I need!!