onlyVisibleForRoles on custom profile property seems not to work properly

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
11/26/2009 12:06:12 PM
Gravatar
Total Posts 14

onlyVisibleForRoles on custom profile property seems not to work properly

Hi,

I created a custom profile property as explained in the documentation. This new property is visible in edit and manage mode if I don't use the onlyVisibleForRoles attribute. I made several tests and this attribute doesn't seem to work. Here are the results of my tests :

Connected with Admins role, it's ok:

role of the profile user looked onlyAvailableForRoles onlyVisibleForRoles View Edit   Admins Admins Admins visible visible ok Admins Admins   visible visible ok Admins   Admins visible visible ok Not Admins Admins Admins     ok Not Admins Admins       ok Not Admins   Admins visible visible ok

Connected with Authenticated Users, there are some bugs :

role of the profile user looked onlyAvailableForRoles onlyVisibleForRoles View   Admins Admins Admins   ok Admins Admins   visible ok Admins   Admins visible bug ? Not Admins Admins Admins   ok Not Admins Admins     ok Not Admins   Admins visible bug ?

Why the custom property is visible for the Authenticated Users role while its onlyVisibleForRoles attribute is set to Admins ?

I hope my question is understandable, if not tell me, I'll try to be clearer.

Rom1

 

11/30/2009 10:02:03 AM
Gravatar
Total Posts 14

Re: onlyVisibleForRoles on custom profile property seems not to work properly

Hi,

Has anybody had the same issue ? Maybe my explanation is not clear ?

To recap, although the onlyVisibleForRoles is set to "Admins" for my custom field in my CustomProfile.config, when I log in with role "Authenticated Users", I still can see my custom field.

I found the code where I could modify it but maybe it's not a bug and I don't use this parameter as it should ?

My mojoPortal version : 2.3.1.9 MSSQL

Thanks for your anwser.

Rom1

11/30/2009 2:22:58 PM
Gravatar
Total Posts 18439

Re: onlyVisibleForRoles on custom profile property seems not to work properly

It would be easier to answer if you post your property definition so I can see all the settings on it.

Best,

Joe

12/1/2009 3:46:21 AM
Gravatar
Total Posts 14

Re: onlyVisibleForRoles on custom profile property seems not to work properly

Excuse me, I haven't thought to post my properties definition, here it is : 

<add name="ProfessionnalPhone"

type="System.String"

allowMarkup="false"

labelResourceKey="Téléphone pro (visible and available for role 'Admins')"

lazyLoad="false"

requiredForRegistration="false"

allowAnonymous="true"

visibleToAnonymous="false"

visibleToAuthenticated="true"

visibleToUser="true"

editableByUser="false"

regexValidationExpression=""

regexValidationErrorResourceKey=""

maxLength="20"

onlyAvailableForRoles="Admins"

onlyVisibleForRoles="Admins"

includeHelpLink="true"

/>

<add name="MobilePhone"

type="System.String"

allowMarkup="false"

labelResourceKey="Téléphone mobile (available for role 'Admins')"

lazyLoad="false"

requiredForRegistration="false"

allowAnonymous="true"

visibleToAnonymous="false"

visibleToAuthenticated="true"

visibleToUser="true"

editableByUser="false"

regexValidationExpression=""

regexValidationErrorResourceKey=""

maxLength="20"

onlyAvailableForRoles="Admins"

onlyVisibleForRoles=""

includeHelpLink="true"

/>

<add name="PersonnalPhone"

type="System.String"

allowMarkup="false"

labelResourceKey="Téléphone personnel (visible for role 'Admins')"

lazyLoad="false"

requiredForRegistration="false"

allowAnonymous="true"

visibleToAnonymous="false"

visibleToAuthenticated="true"

visibleToUser="true"

editableByUser="false"

regexValidationExpression=""

regexValidationErrorResourceKey=""

maxLength="20"

onlyAvailableForRoles=""

onlyVisibleForRoles="Admins"

includeHelpLink="true"

/>

 

I tried with a custom role and it doesn't seem to work too...

Best,

Rom1

12/1/2009 7:02:29 AM
Gravatar
Total Posts 18439

Re: onlyVisibleForRoles on custom profile property seems not to work properly

Hi,

If you only want it visible to certain roles then you should not have this:

visibleToAuthenticated="true"

Also you should put a semi colon after role names like Admins;

Hope it helps,

Joe

12/1/2009 7:39:50 AM
Gravatar
Total Posts 14

Re: onlyVisibleForRoles on custom profile property seems not to work properly

Thanks for your answer Joe, here is my new property definition :

<add name="PersonnalPhone"

type="System.String"

allowMarkup="false"

labelResourceKey="Tlphone personnel (visible for role 'Admins')"

lazyLoad="false"

requiredForRegistration="false"

allowAnonymous="true"

visibleToAnonymous="false"

visibleToUser="true"

editableByUser="false"

regexValidationExpression=""

regexValidationErrorResourceKey=""

maxLength="20"

onlyAvailableForRoles=""

onlyVisibleForRoles="Admins;"

includeHelpLink="true"

/>

I have deleted the visibleToAuthenticated="true" and put a semi colon after role name but my custom property is still visible when connected with a user without Admins role.

Could you send me a customprofile.config that works, for trying it and see what happens ?

Best,

Rom1

12/1/2009 7:44:16 AM
Gravatar
Total Posts 18439

Re: onlyVisibleForRoles on custom profile property seems not to work properly

Is the user you connect as looking at his own profile or someone else's profile? He will see it on his own profile with visibleToUser="true" but he should not see it on someone else's profile. 

12/1/2009 8:28:42 AM
Gravatar
Total Posts 14

Re: onlyVisibleForRoles on custom profile property seems not to work properly

The user I connect as is looking at someone else's profile...

Rom1

12/1/2009 8:33:19 AM
Gravatar
Total Posts 18439

Re: onlyVisibleForRoles on custom profile property seems not to work properly

Ok, I will investigate this as a bug.

Best,

Joe

12/1/2009 8:37:58 AM
Gravatar
Total Posts 14

Re: onlyVisibleForRoles on custom profile property seems not to work properly

Ok, thank you Joe.

If it can help you, I think the pb is at line 248 of ProfileView.aspx.cs...

Best,

Rom1

12/1/2009 9:40:36 AM
Gravatar
Total Posts 18439

Re: onlyVisibleForRoles on custom profile property seems not to work properly

Hi Rom1,

I was able to produce the problem using your property definition and was able to fix it.

This will be fixed in the next release and the fix will be in svn trunk by tonight sometime.

Thanks,

Joe

You must sign in to post in the forums. This thread is closed to new posts.