Issue with permission prompt

Hello Pro

My app work fine old version mac OS, But when I update to MacOS Catalina. It have issue.

That issue: When app open the file, system show permission prompt with two option [Don't Allow] Or [OK} ( content msg: "*.app" would like to access files in your desktop folder.) . If user select [Don't Allow] , app continues with some issue.

I think solution to solve issue:

When open file and system show permission promt:

+ if user select [Don't Allow] on permission prompt=> Close app

+ If user select [OK] on permission prompt=> continue open file


I less experience with App on macOS. I'm not yet to implement it.

And I have question:

How to check status of permisison promt whether use select [Don't Allow] or not?

what is API to get info( Allow the app to access files and folders?

Thanks for your advice