Permission in a custom app

I have created my own app. My app has 3 tab: tab 1, tab 2, tab 3. Its database consists of a table named units with unit 1, unit 2. Now I want tab 1 to be displayed only for unit 1, tab 2 is shown only for unit 2 . How can I do that?

It’s been 2 days and no comments here.

first off you supply no information at all.
to what do you want a answer.
how is this nextcloud related.

yes we can assume you talking about a nextcloud app for the web interface but it might as well be a android app. we don’t know.

it uses a database. which one ? what type ?

what version of nextcloud are you creating a app for?

should this not be posted in development instead of support.

if you do not know how to connect to your database and extract info from it you expect other to do/write it for you you should post in freelance.

I am using NC22. I created my own database in MySQL and connected to NC. The problem is that I don’t know which API can allow me to retrieve the current user’s data.