Hi Alfresco community. I'm working on a project and i need to populate a selectone with a contact list from repository. The contact list depent of current logged user group. I created a data webscript in order to get contact list but when i try to get currently share logged user i always get admin. What is the best way to get contact list based on share logged user's role?
Did you by any chance define your web script as "runAs" with the user admin? Only that would explain "always" getting the logged-in user as "admin" (except if your are always testing as admin of course).
You know that instead of implementing a custom web script, you could also use a registered LIST constraint implementation (Java-based) for the property which dynamically resolves contacts in its implementation of getAllowedValues
Thanks Axel for your reply and sorry for my english. I will make a research
about registered list if you have an example about how to user i will
appreciate it.
Hello.
You can find a sample here alvex-masterdata/MasterDataConstraint.java at master · ITDSystems/alvex-masterdata · GitHub
My problem is a little more complex. In my project i have a document type
CompanyDoc and a association for it with a user, based on user's group.
Through a action form i need to setup this association not using edit
metadata action because i need to execute more business logic during
association establishment. In action form user need to choose with who user
want to establish the association, this user list should be populated
dynamically based on current logged user group. That is my real situation
any idea would be grateful.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.