I want to hide the delete tab from the menu so no body can delete any thing from database while accessing through dataface. Similarly if I can define which table could be edited or not.
Best to handle this with permissions. Read
http://xataface.com/documentation/tutor ... ermissionsTo get primed on how permissions works.
A good way to lock down permissions on the entire app (i.e. make it read only) is to add a getPermissions() method to your application delegate class:
- Code: Select all
function getPermissions(&$record){
return Dataface_PermissionsTool::READ_ONLY();
}
Of course if you want the users to be able to add and edit still, just not delete, you would do something a little different.
e.g.
- Code: Select all
function getPermissions(&$record){
return Dataface_PermissionsTool::getRolePermissions('EDIT');
}
If you want different settings for different tables you can add getPermissions() method to delegate classes of individual tables to override permissions.
Check the dataface permissions.ini file to see what permissions and roles are available. You can also try searching the site for permissions and roles and there is lots of stuff in the forum that you might find helpful.
Another concern for me is the table fields in my database are set to Not Null but my Joomla site can still keep the fields blank, and even appgini was able to do that.
is there any way something like Ignore Not Null fields while update.
Not sure what you mean by "ignore" not null fields. Xataface only updates fields that have been changed, so if you leave the fields alone, then so will xataface.
One way to ensure that your users leave those fields alone is through permissions.
e.g. in the table delegate class:
- Code: Select all
/**
* Set permissions on field named 'myfield' to read only
*/
function myfield__permissions(&$record){
return Dataface_PermissionsTool::READ_ONLY();
}
or
/**
* Set no access on field named my_field
*/
function myfield__permissions(&$record){
return Dataface_PermissionsTool::NO_ACCESS();
}
Another way to do it would be to just change the widget of these fields to hidden.
e.g.
- Code: Select all
widget:type=hidden
However if they are NOT NULL fields then the users won't be able to insert new records unless they deal with them (that's what not null fields are).
-Steve