onlyAvailableForRoles option does not 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.
1/19/2007 10:14:19 AM
Gravatar
Total Posts 488

Re: onlyAvailableForRoles option does not work properly

Now it works on /Admin/ManageUsers.aspx for both en-US and ru-RU.

But for both russian and english locales it still:
1. Shows previously stored WebSiteUrl value for "Admins" role on /MemberList.aspx (I have this property only for "Customers" role)
2. Shows incorrect properties set on /ProfileView.aspx
3. Shows incorrect properties set on /ProfileView.aspx
1/19/2007 10:38:19 AM
Gravatar
Total Posts 18439

Re: onlyAvailableForRoles option does not work properly


1. then clear that property from the admin user in the db, I'm not going to code for that, having WebSiteUrl based on roles is a highly unusual use case to begin with

2 and 3 are the same?, please clarify what you mean incorrect properties. I implemented it so that if you are in the role you see the property, except admins who see all as nothing is hidden form admins and IsInRole always returns true for Admins.

Joe
1/19/2007 10:43:11 AM
Gravatar
Total Posts 18439

Re: onlyAvailableForRoles option does not work properly

ok, I see what you mean, if I'm in the role I see the property for all users on ProfileView, I will fix that.

Joe
1/19/2007 10:48:33 AM
Gravatar
Total Posts 488

Re: onlyAvailableForRoles option does not work properly

1. I agree, I just noticed it because my test property was WebSiteUrl.

2 and 3. - yes, they are the same, it's a writing mistake.
Ok, waiting for the fix.

I think that having all roles for admins is not a good solution.
For example I have some mandatory fields (like zip, passport no, etc) for customers and do not want to have them mandatory for admins.
1/19/2007 10:58:56 AM
Gravatar
Total Posts 18439

Re: onlyAvailableForRoles option does not work properly

They properties for Customers will not show up on ManageUsers.aspx when viewing the Admin user's profile unless he (the Admin) is also in customer role. However the admins will see that property when viewing the profiles of customers, no properties are hidden from Admins. Admins do not inherit all properties.

To be more clear, WebUser.IsInRoles always returns true for Admins and is what is used to check the roles of the httpcontext user, but siteUser.IsInRoles only returns true if the user is in the role and should be used to check the roles of a user other than the httpcontext user

ProfileView is now fixed in svn, it only shows the property if the httpcontextuser and the user whose profile is being viewed are both in the role, that is WebUser.IsInRoles and siteUser.IsInRoles both must be true if roles are specified for the property

Joe
1/19/2007 11:22:33 AM
Gravatar
Total Posts 488

Re: onlyAvailableForRoles option does not work properly

I have updated and recompiled.

On my testing environment admin is only in roles "Admins" and "Authenticated Users".
I login as admin and
    - go to /ProfileView.aspx - everything is correct (WebSiteUrl for customer, Gender for manager, none for admin)
    - go to /Admin/ManageUsers.aspx - everything is correct (WebSiteUrl for customer, Gender for manager, none for admin)
    - go to /Secure/UserProfile.aspx - I can see both Gender and WebSiteUrl properties there (for both en-US and ru-RU)
1/19/2007 11:36:21 AM
Gravatar
Total Posts 18439

Re: onlyAvailableForRoles option does not work properly

oh, you are right, should be using siteUser.IsInRoles not WebUser.IsInRoles on the UserProfile page in order to handle admin profile correctly.
Fixed in svn.

Joe
1/19/2007 11:59:35 AM
Gravatar
Total Posts 488

Re: onlyAvailableForRoles option does not work properly

Still having problems.

1. Login as customer, go to /ProfileView.aspx of customer - ok, go to /ProfileView.aspx of manager - no properties are displayed.
2. Login as manager, go to /ProfileView.aspx of manager - ok, go to /ProfileView.aspx of customer - no properties are displayed.
3. Logout, set AllowAnonymousUsersToViewMemberList option in web.config to "true", go to /ProfileView.aspx - see WebSiteUrl property for all users and nothing more (except a message that some properties were hidden as I am not logged in).

P.S. UserProfile page works properly now.
1/19/2007 12:34:14 PM
Gravatar
Total Posts 18439

Re: onlyAvailableForRoles option does not work properly

Maybe I didn't understand your original request for the role based property feature. I did not think users should be able to see properties for roles which they are not in regardless of whether they are logged in or not. If a property is only for managers my thinking was others should not be able to see that property, only other managers (or Admins) will see that.

I can change this but thats what I thought you wanted. It sounds (now) like you only want the role to determine only who has the property but visibility of the property is determined only on IsVisibleToAnonymous and IsVisibleToAuthenticated?

Joe
1/19/2007 1:27:03 PM
Gravatar
Total Posts 488

Re: onlyAvailableForRoles option does not work properly

I want the property onlyAvailableForRoles to work as follows: the specified profile property just exists for users in one of the specified roles, and do not exist in any others.
So, it is showed in profile of users of the specified roles and is not showed in any other ones'.

Property visibility in this case is determined by onlyAvailableForRoles, IsVisibleToAnonymous and IsVisibleToAuthenticated - if it is not available for some user (due to the role set) it is not displayed anyway.

For your understanding of the feature there should be some property option like onlyVisibleToRoles. It will also be nice to have it (may be even instead of IsVisibleToAuthenticated), but it is not the one I originally requested.

P.S. May be, "onlyExistsForRoles" "onlyHandledForRoles" would be a better name for this option.
1/19/2007 2:32:51 PM
Gravatar
Total Posts 18439

Re: onlyAvailableForRoles option does not work properly

I like onlyAvailableForRoles and onlyVisibleForRoles better than onlyExistsForRoles and onlyHandledForRoles

I've implemented this in svn.

I'll update the documentation as soon as I get a chance.

Thanks,

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