check access before crud events

Questionscheck access before crud events
Wing asked 2 years ago

Before any of the crud events happens, I want to check if the current user has access to do so.
Is there a way to do this?
 
I used general language to show what i’m thinking. is it possible to:

$e[“on_insert”] = array(“add_client”, null, true); 
$e[“on_delete”] = array(“del_client”, null, true); 
$g->set_events($e); 
function add_client($data) 

    global $g; 

    // CHECK IF CURRENT USER HAS ACCESS
    //  IF NO, SHOW ERROR else CONTINUE DEFAULT INSERT
}
function del_client($data) 

    global $g; 

    // CHECK IF CURRENT USER HAS ACCESS
    //  IF NO, SHOW ERROR else CONTINUE DEFAULT DELETE

 
thanks.

1 Answers
Abu Ghufran Staff answered 2 years ago

Yes, that’s the correct way to do it.
Also refer demos/editing/server-validation.php for help.

_________________________
Abu Ghufran - Dev Team
PHP Grid Framework
 
Your Answer

16 + 11 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!