I have created a customer menu in the _headerModulesList.tpl, but i would like to only display it when users with a certain role are loggine in.
I am able to get the Users ID within the _headerModulesList.tpl. So my question is, does any one know a way or point me to documentation that will allow me to get the users roles within a varible or how to run SQL within a tpl file to allow me get get it.
Or any other suggestions how this can be achived?
Sugar Version 6.5.25 (Build 344)
Thanks for the information. I didn’t use that exact example, but it gave me terms to google what did result in me achieving what i wanted.
So for running php on a tpl template file I used this: https://www.smarty.net/docsv2/en/language.function.php.tpl
And for working our the roles of a use I used this. It is slightly more refined than the one mentioned in the post above as it uses cache data first to see if it can find the users role.
https://hotexamples.com/examples/-/ACLRole/getUserRoleNames/php-aclrole-getuserrolenames-method-examples.html (example 3)