Custom button privilege

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
sangnandar
User
Posts: 980

Custom button privilege

Post by sangnandar »

My setup.
Page_DataRendering()
$header = '<a href="(myTable)add.php">'; // custom button to add record of myTable

I need this $header off when an userID don't have privilege to add record into myTable. Something like this,
Page_DataRendering()
if (userID has privilege to add record into myTable)
$header = '<a href="(myTable)add.php">';
else
$header = '';

Is there built in function I can use to check this condition?

Thanks.


arbei
User
Posts: 9286

Post by arbei »

Use the CanAdd() function in the Security Object to be your condition.

For example:
if ($Security->CanAdd()) {
// Your code.
}


sangnandar
User
Posts: 980

Post by sangnandar »

Thanks.


Post Reply