Does thisapp.portal.profileForUser work for demo users? i.e. in an environment

Does thisapp.portal.profileForUser work for demo users? i.e. in an environment

I am developing updates and have set up environments under Creator 6. I am attempting to test code that should react based on the permission set of the logged in user, however when I call thisapp.portal.profileForUser I get an empty string:

  1. userEmail = thisapp.permissions.loginUserEmailid();
  2. username = thisapp.permissions.loginUsername();
  3. userProfile = thisapp.portal.profileForUser(username);
  4. alert username + ":" + userEmail + ":" + userProfile;
Results in "demouser_1:demouser_1@zohocreator.com:". Note the final `:` indicating that there is no data in the userProfie variable.

Is this the correct function to fetch the name of the item under "Portal User Permissions" for a portal user? Or is it not possible to use this function in a non-production environment?