Roles or SQL in _headerModulesList.tpl

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?

Thanks

Version 7.10.7

Sugar Version 6.5.25 (Build 344)

Check this sample for some ideas:

http://urdhva-tech.blogspot.com/2013/08/readonly-field-conditionally.html

1 Like

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)