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/17/2007 7:31:04 AM
Gravatar
Total Posts 488

onlyAvailableForRoles option does not work properly

I have created my own file instead of mojoProfile.config and added a line to user.config to replace it.

In my file I have 2 profile properties, one with 'onlyAvailableForRoles="Managers"', the other with 'onlyAvailableForRoles="Customers"' (both "Customers" and "Managers" are existing site roles).

1. User in the role "Admins" has both properties.

2. It seems that (on pages /Admin/ManageUsers.aspx, /ProfileView.aspx, etc) properties visibility is based on current logged in user roles, but not on the roles of the user whos profile is being veiwed/edited. That is not correct.
1/17/2007 5:11:55 PM
Gravatar
Total Posts 18439

Re: onlyAvailableForRoles option does not work properly

I will look into improving this soon. I had to get the 2.2.1 release out quickly to fix a significant bug in the forums module.

Thanks,

Joe
1/18/2007 2:53:07 AM
Gravatar
Total Posts 488

Re: onlyAvailableForRoles option does not work properly

Ok, I shall wait for a while with this...
1/18/2007 5:13:02 PM
Gravatar
Total Posts 18439

Re: onlyAvailableForRoles option does not work properly

This is now fixed in svn branches/2.x, you'll need to run the stored proc script to get the latest procs.

Thanks,

Joe
1/19/2007 5:12:50 AM
Gravatar
Total Posts 488

Re: onlyAvailableForRoles option does not work properly

I have updated from SVN and rerun the script 3CreateStoredProcedures.sql - nothing changed.

Properties visibility is still based on the roles of currently logged in user, but not the one whose profile I am looking at.

My testing file (WebProfile.config instead of mojoProfile.config):





<?xml version="1.0"?>
<mojoProfile>
    <properties>
        <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
               
             PROPERTIES FOR MANAGERS (role 'Managers')
       
             * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
        -->

        <add    name="Gender"
                type="System.String"
                allowMarkup="false"
                labelResourceKey="GenderLabel"
                lazyLoad="false"
                requiredForRegistration="false"
                allowAnonymous="false"
                visibleToAnonymous="false"
                visibleToAuthenticated="true"
                visibleToUser="true"
                editableByUser="true"
                regexValidationExpression=""
                validationErrorResourceKey=""
                onlyAvailableForRoles="Managers"
                defaultValue=""
                includeHelpLink="true"
                >
            <OptionList>
                <Option value="" TextResourceKey="GenderUnselectedLabel"></Option>
                <Option value="M" TextResourceKey="GenderMaleLabel"></Option>
                <Option value="F" TextResourceKey="GenderFemaleLabel"></Option>
            </OptionList>
        </add>
               
        <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
               
             END OF PROPERTIES FOR MANAGERS (role 'Managers')
       
             * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
        -->





        <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
               
             PROPERTIES FOR CUSTOMERS (role 'Customers')
       
             * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
        -->

        <add    name="WebSiteUrl"
                type="System.String"
                allowMarkup="false"
                labelResourceKey="WebSiteUrlLabel"
                lazyLoad="false"
                requiredForRegistration="false"
                visibleToAnonymous="true"
                visibleToAuthenticated="true"
                visibleToUser="true"
                editableByUser="true"
                regexValidationExpression="(((http(s?))\://){1}\S+)"
                regexValidationErrorResourceKey="WebSiteUrlRegexWarning"
                maxLength="100"
                columns="45"
                onlyAvailableForRoles="Customers"
                includeHelpLink="false"
                        />

        <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
               
             END OF PROPERTIES FOR ALL CUSTOMERS (role 'Customers')
       
             * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
        -->
 
    </properties>
</mojoProfile>




I have 2 users on my site (except admin) - customer (roles: Authenticated Users; Customers) and manager (roles: Authenticated Users; Managers).
When I log in as customer everyone has only
WebSiteUrl. When I log in as manager everyone has only Gender.
When I log in as admin everyone has both properties.
1/19/2007 7:38:08 AM
Gravatar
Total Posts 18439

Re: onlyAvailableForRoles option does not work properly

Did you re-compile? It works correctly when I test it here.

In the mojoProfile.config file there is a commented out DateOfBirth property configured for Content Administrators
When I add that property (by uncommenting it) and login as Admin and look at user profiles on the ManageUsers.aspx page, I only see DateOfBirth on the profiles of users in the Content Administrators role.

Joe
1/19/2007 8:42:19 AM
Gravatar
Total Posts 488

Re: onlyAvailableForRoles option does not work properly

Once more I updated, rebuilt the solution, runned the script 3CreateStoredProcedures.sql and iisreset - the same result.

Just forgot to mention, I use MSSQL data.
1/19/2007 9:04:50 AM
Gravatar
Total Posts 18439

Re: onlyAvailableForRoles option does not work properly

Are you sure its using your custom file and not mojoProfile.config?
Can you step through the code in ManageUsers.aspx.cs and see if it sees the role requirement for those properties.
Also make sure the role names specified correspond to RoleName column in db not DisplayName

Joe
1/19/2007 9:45:12 AM
Gravatar
Total Posts 488

Re: onlyAvailableForRoles option does not work properly

I founded out that on /Admin/ManageUsers.aspx it works for en-US browser locale and does not for ru-RU.

I just created the roles and did not rename them, so role names and captions should be the same.
1/19/2007 9:59:28 AM
Gravatar
Total Posts 18439

Re: onlyAvailableForRoles option does not work properly

Ok, I just committed a change to svn branches/joesandbox2 that may fix it, can you try it?

Thanks,

Joe
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
You must sign in to post in the forums. This thread is closed to new posts.