Page 1 of 1

Custom button privilege

Posted: Thu Dec 07, 2017 11:14 am
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.


Re: Custom button privilege

Posted: Thu Dec 07, 2017 1:07 pm
by arbei

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

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


Re: Custom button privilege

Posted: Thu Dec 07, 2017 1:49 pm
by sangnandar

Thanks.