Welcome Guest Search | Active Topics | Log In | Register

Roles Automatically Re-Linked Options · View
Tookiewana
#1 Posted : Monday, October 06, 2008 2:52:07 AM
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?
Tookiewana
#2 Posted : Tuesday, October 07, 2008 3:52:25 AM
Rank: Member




Joined: 4/9/2008
Posts: 10
FYI: It appears that this issue still happens with the 1.9.3 RC1 release.
Jaben
#3 Posted : Tuesday, October 07, 2008 4:22:34 AM

Rank: YAF Head Dude



Joined: 10/10/2004
Posts: 3,045
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”."

Tookiewana
#4 Posted : Tuesday, October 07, 2008 3:10:38 PM
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.
Jaben
#5 Posted : Tuesday, October 07, 2008 11:46:00 PM

Rank: YAF Head Dude



Joined: 10/10/2004
Posts: 3,045
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”."

Tookiewana
#6 Posted : Wednesday, October 08, 2008 1:15:58 AM
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>
Tookiewana
#7 Posted : Wednesday, October 08, 2008 3:18:42 PM
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.
juanp2
#8 Posted : Monday, October 13, 2008 10:27:16 AM
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.


test2005
#9 Posted : Tuesday, October 14, 2008 10:55:26 AM

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.....

juanp2
#10 Posted : Wednesday, October 15, 2008 7:22:30 AM
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>
juanp2
#11 Posted : Wednesday, October 15, 2008 12:44:44 PM
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.
test2005
#12 Posted : Wednesday, October 15, 2008 3:01:19 PM

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.....

juanp2
#13 Posted : Thursday, October 16, 2008 9:04:48 AM
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.

test2005
#14 Posted : Thursday, October 16, 2008 12:42:51 PM

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"!! Razz Nor would they ask "what's wrong with you""" Razz Razz

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.

Smile
.....the man in black fled across the desert..........and the gunslinger followed.....

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.3 RC2 | YAF © 2003-2008, Yet Another Forum.NET
This page was generated in 0.138 seconds.

SourceForge.net Logo Powered by ASP.NET v2.0 411ASP.NET