Hello all,
I was wondering whether I can password protect the edit possibility of a line in the grid ?
We would like that everybody can SEE the full grid with values but edit should only be possible after entering userid and password (which could come from a user table).
Any possibility for this ?
Thanks very much in advance,
Davy
Grid is an independent lib. You need to implement the authentication system byself.
However, you can put conditional session variable checks on set_action() function to make it editable if authenticated, otherwise not.
Hey Abu,
may I be so blunt to ask if I can find an example of this somewhere ? I have already worked with the set_action before (for opening another screen when pushing a button) but how could I tell the button to simply do what normally the edit button does (after checking security then).
Greetings and thanks in advance,
Davy
Assume your authenticated session have session var … logged_in
if ($_SESSION["logged_in"] == 1)
{
$edit = true;
}
else
{
$edit = false;
}
and now for e.g.
$g->set_actions(array(
"add"=>true, // allow/disallow add
"edit"=>$edit, // allow/disallow edit
"delete"=>true, // allow/disallow delete
)
);