I was design a page as below.
In this design have a Country field. I want the country list will be display only countries that the current AEM user have permission to access. I will create a tree folder or tree node for country and city. So, I will configuration for the user or user group can access to special country or city. The all country list and all city list call from the service API.
Please help me,
Thank you so much,
You can't don't it with Sightly alone.
Where you can read users permission against tree and push node that have read permission in list using JAVA and read those list in Sightly.
You can check
I guess the best way is to create a small Sling model class to format the data in the way you want it. And regarding the permissions: You don't have to do anything. If you are working in a request, all Sling and JCR methods will only return resources and nodes for which the current user has read access to. The filtering and permission checks are done implicitly.
Thank you for your help,
Thanks & Best regards,
You need data from the repository and I don't think that you can do that with HTL alone; you need to have a server-side model.
Could you help me how to do that?
Thank you so much!
You don't need to check permissions with the API, because every node and resource is already checked.