Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Fadi on Aug 29, 2009 08:59
open dhtmlx forum
Security and Permissions

In creating various views, I need to be limit access to some data by individual users.

I'd like to know how you suggest I limit, on an individual field basis & for individual records, access to the following privileges:
1- View
2- Write/Modify/Delete

Thank you.
Answer posted by Support on Aug 31, 2009 02:54
Assuming that you are using PHP connectors

You can use beforeProcessing event to introduce custom rules

function custom_rules($action){
            $id = $action->get_id();
            $operation  =  $action->get_status();

            if (!some_kind_of_validaton($id,$operation))
                   $action->invalid(); //block operation

           //if you need to block operations for some field
           $action->remove_field("some_name");  //the named field will be removed from operation, basically it is set to readonly mode
}
$grid->event->attach("beforeProcessing","custom_rules");