Displaying ADD Page Links in Custom File Based on User Permissions

Hello,

I want to add links to the ADD pages in the “Custom File” section of my project. However, I only want these links to be visible to users who have the necessary permissions (e.g., the ADD permission).

Is there a way to achieve this?

Thank you.

For example, from demo2025 project, in one of your Custom Files, you want to display the link for Add page of orders table:

if (Security()->allowAdd(CurrentProjectID() . 'orders') && Security()->canAdd()) {
    // your code to show the Add Page link 
}

Note that you need to adjust that code to your own requirements.

Thanks for your reply.
Just…

If I want to add these links dynamically from an API using AJAX, will this security check code function correctly within the API context?

Let me be clearer…
I’m planning to add these ‘Add Page’ links dynamically via an API endpoint and AJAX. Will the provided security check (if (Security()->allowAdd(CurrentProjectID() . 'orders') && Security()->canAdd())) still accurately enforce permissions when executed within the API’s PHP code?

You may test it by yourself first, and you may post your code for discussion.