I have set up some additional profile elements, and I want to limit the access to change them to just Administrators and Role Administrators...
<add name="Credentials" type="System.String" allowMarkup="false" resourceFile="ProfileResource" labelResourceKey="Staff Member Credentials" lazyLoad="false" requiredForRegistration="false" allowAnonymous="false" visibleToAnonymous="true" visibleToAuthenticated="true" visibleToUser="true" editableByUser="true" regexValidationExpression="" regexValidationErrorResourceKey="" maxLength="100" cssClass="widetextbox" onlyAvailableForRoles="Administrators;Role Administrators" onlyVisibleForRoles="" includeHelpLink="true" />
...the problem is that when I set the value in "onlyAvailableForRoles", the main Admin account (myself) cannot see these anymore...
mojoPortal Hosting & Design @ i7MEDIA!
Roles have both a role name and a display name, the Administrators role name is Admins, though I know that is a little confusing it can't be changed for historical reasons. The display name of roles can be edited but the role name cannot.
Note that onlyAvailableForRoles means this property is only available on users who are members of those roles, ie it won't be a property on users who are not in those roles.
Hope that helps,
Thank you for your response Joe! : ) I have tried a number of different combinations and nothing seems to be working.
At first, I thought it was the difference between "Admins" and what is set up under "Role Administration" on the main site, which now reads "Administrators", of which I am a member ("Admin"). But I have tried "Admins", "Admins;Administrators;" and just "Administrators" for onlyAvailableForRoles, and nothing seems to make this visible to just my account ("Admin").
I guess I'm also not clear on the difference between onlyAvailableForRoles and onlyVisibleForRoles.
I also tried to create a new member/user and I still cannot get these items to show.
Does one have to restart the server or something after making custom changes to a mojoProfile.config file? I have tried to go into the Web.config file and make a change, thinking that might do something, but this doesn't seem to make any difference either...
What I am trying to do is set up custom profile items that are only available and/or visible to Administrators and Role Administrators to set up, but I would also want them to be displayed in any member list on the site.
I do appreciate any direction you might be able to provide... : ) Thanks again!
I went back to the main site and changed the display name back to "Admins" (Administration Menu >Role Administration), then updated my custom profile file on the secondary site, mojoCustomProfile.config and set it to onlyAvailableForRoles="Admins;Role Administrators", but the profile item is still not visible. Is there something that perhaps I need to reset somewhere?
Thanks again Joe and Joe! : )
ah ha! I think I understand what you're saying now Joe A. : )
hmmm.... changed two lines to
onlyAvailableForRoles="Staff Members" onlyVisibleForRoles="Admins;Role Administrators"
the profile belongs to the role "Staff Members", and my account is a member of "Admins", but I still can't see the profile item...
as Joe D pointed out.
Look in the database in the mp_Roles table and make sure your RoleName there is what you think it is ie "Staff Members", if it matches the rolename in the database it should work, I just tested it here and it works for me.
fyi, I implemented support for CheckboxList questions in user profile today. It is in the source code repository now so it will be in the next release. There is an example in comments in mojoProfile.config
Hey thanks! : ) That's speedy!
It looks like I somehow have 3 "Admin" accounts in the database. I don't suppose you have an UPDATE/JOIN statement you might have used for this kind of thing before do you... ? :D
ah - nevermind - It's probably because I have three sites lol