|
|
Rank: Member

Joined: 4/9/2008 Posts: 10
|
I am using the default Sql Membership and Role Providers with an existing user database along with a separate YAF database. I am finding that YAF is automatically re-linking all of the existing roles to YAF. When I go to YAF administration under roles, I click all of the links to "Delete from YAF". After logging out of my site and logging back in, I find that the roles are relinked to YAF. Is the YAF code doing this or am I missing something?
|
|
|
Rank: Member

Joined: 4/9/2008 Posts: 10
|
FYI: It appears that this issue still happens with the 1.9.3 RC1 release.
|
|
|
 Rank: YAF Head Dude

Joined: 10/10/2004 Posts: 3,050 Location: Honolulu, HI
|
Can you verify these unlinked groups are NOT in the yaf_Group table? "When you are grateful, fear disappears and abundance appears”." 
|
|
|
Rank: Member

Joined: 4/9/2008 Posts: 10
|
Jaben wrote:Can you verify these unlinked groups are NOT in the yaf_Group table? Yes I can. I deleted the roles from YAF in the YAF Admin page, and verified that the unlinked groups are not in the yaf_Group table. Then I logged out and back in again, and the roles that are not supposed to be linked to YAF automagically come back and are re-added to the yaf_Group table with new indexes.
|
|
|
 Rank: YAF Head Dude

Joined: 10/10/2004 Posts: 3,050 Location: Honolulu, HI
|
Can you post your membership settings so I can duplicate/test? Yeah, something ain't working right.... "When you are grateful, fear disappears and abundance appears”." 
|
|
|
Rank: Member

Joined: 4/9/2008 Posts: 10
|
Jaben wrote:Can you post your membership settings so I can duplicate/test? Yeah, something ain't working right.... <membership defaultProvider="SqlMembershipProvider" hashAlgorithmType="SHA1"> <providers> <clear/> <add name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="Users" applicationName="Website" requiresUniqueEmail="true" /> </providers> </membership> <roleManager enabled="true" defaultProvider="SqlRoleProvider"> <providers> <clear/> <add name="SqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="Users" applicationName="Website" /> </providers> </roleManager>
|
|
|
Rank: Member

Joined: 4/9/2008 Posts: 10
|
Jaben,
This seems to be fixed in RC2. I downloaded and installed it today, and the unlinked roles are now staying unlinked as they should.
|
|
|
Rank: Member
Joined: 9/27/2008 Posts: 20
|
Tookiewana wrote:Jaben,
This seems to be fixed in RC2. I downloaded and installed it today, and the unlinked roles are now staying unlinked as they should. Just verified the problem still exists in RC2. Steps to repeat are: 1) Unlink some roles... 2) Goto YAF>>Administration>>Users>> Edit User 3) Searched (user name) and select a user. 4) Select "edit". (opens the user's info) 5) And select the User Role tab. (don't edit anything, just look at the info..note that it shows both linked and unlinked roles) --> roles are now relinked. As well, unless this is by design, I'm finding that in RC2, (VS2005) a rebuild will cause the roles to relink.
|
|
|
 Rank: YAF MVP

Joined: 2/12/2005 Posts: 927 Location: Italy
|
Are you sure they are "linked" and not just being "displayed"? I have removed several "linked" roles. They display under a user if viewed, but are not "re-linked" .....the man in black fled across the desert..........and the gunslinger followed.....
|
|
|
Rank: Member
Joined: 9/27/2008 Posts: 20
|
test2005 wrote: Are you sure they are "linked" and not just being "displayed"?
I have removed several "linked" roles. They display under a user if viewed, but are not "re-linked"
It might be an issue related to how my web config is setup. I'm using the YAF profile provider but the default asp.net role and membership providers. I was assuming the profile might be independant of the role and membership, but could be wrong. I'm going to do a reinstall of YAF in its own project and see if I can recreate the problem. If not.. I know its a provider issue and not YAF related per say. Code: <roleManager enabled="true" /> <membership> <providers> <remove name="AspNetSqlMembershipProvider"/> <add name="AspNetSqlMembershipProvider" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" [...snip....] type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> </providers> </membership>
<profile enabled="true" defaultProvider="AspNetSqlProfileProvider" inherits="YAF.Classes.Utils.YafUserProfile"> <properties> .... </profile>
|
|
|
Rank: Member
Joined: 9/27/2008 Posts: 20
|
Confirmed.. it is still an issue in a default YAF install. Just did a fresh install of YAF, from RC2, using the defaults.
I think when the role is deleted from YAF (unlinked), it is not getting deleted from user's roles (if it was assigned). So when you look at a user that had the role assigned, it is getting re-linked.
I'm tired.. so I'll try to get this right.
In the admin section 1) Create a new role in yaf. 2) Add the role to a yaf user. 3) Unlink the role. Interface says it is unlinked. 4) Search for the user in step 2, find the user and edit the user. 5) don't think it is necessary but I looked at the user's role's tab. I can see they are still assigned to an unlinked role. ... role is relinked...
I think I saw another path that causes relinking as well, but can't repeat it at this moment.
==== If someone is looking at this.. probably would be an idea to look at it from the perspective of where the role provider is inherited as well. What I'm seeing, in this situation, is probably related. I have roles not added through yaf but pre-existing and yaf shows them just fine. But everytime I open a user, it shows both the yaf linked and non-yaf linked roles that the user is a member of, and relinks them.
|
|
|
 Rank: YAF MVP

Joined: 2/12/2005 Posts: 927 Location: Italy
|
Right...this behavior is confirmed. Not sure if it's an error though. I have several roles NOT related to my YAF deployment in any way. I DO NOT assign them to YAF users. However, if I do, the role gets re-linked. My knowledge of the AspNetSqlMembershipProvider and AspNetSqlRoleProvider (what I use) is not great, but this behavior makes sense to me. IF....and someone please correct me if wrong....IF you assign a role in YAF, it will get linked. YAF will "think" you want to use it. Yes!? No!? So if you un-link a role, you need to remove it from all "non-admin" users, as that's what I tested. Which, again, makes sense to me. I do see what your saying though. .....the man in black fled across the desert..........and the gunslinger followed.....
|
|
|
Rank: Member
Joined: 9/27/2008 Posts: 20
|
Well, if Yaf is running independantly, the roles defined are for the sole purposes of yaf of course. If someone adds a role to YAF it is then because they want to use it in YAF. If someone were to unlink a role 'in-user' I'd think YAF should tell the user the role is in use and offer to remove it from all users. That would be the most user friendly from the perspective of an administrator.
In my cicumstances, integrating YAF into a parent application, what I don't like, is that when a user is viewed, all their roles are displayed (since I cannot unlink the roles). Both the roles in YAF and the roles (I'm trying to unlink) in the parent application are publically displayed when viewing the user (i.e. a Member search). I don't mind someone seeing that user X is such-and-such type of a member of yaf, but they have no business knowing the roles of the user in the parent application. That is private data and the role name can give out a lot of information.
Imagine this setup was being used in a farmacy web site and the users have roles in the parent application based on their prescribed access to drugs. Anyone in the forums could then see that "Nancy Chimona" is in the role 'STD' and user "Joe Smith" is in the role "cancer". A role can carry a lot of information.
|
|
|
 Rank: YAF MVP

Joined: 2/12/2005 Posts: 927 Location: Italy
|
juanp2 wrote:....what I don't like, is that when a user is viewed, all their roles are displayed.... Administration >> Host Settings >> Show/Display Items >> "Show Groups" ...disable it. A pharmaceutical related website would not create "roles" of "cancer" or "STD"!!  Nor would they ask "what's wrong with you"""  But kiding aside, I do see your point. Best to just hide it. If it bothers you, modify YAF to correct for the difference. Be sure to post your work here so others wanting to do the same have an easier time of it.  .....the man in black fled across the desert..........and the gunslinger followed.....
|
|
|
| Users browsing this topic |
|
Guest
|