Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Engage Software - Training Partner for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

Click here to go to dev.live.com for Windows Live developer resources
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  GetUsersByRoleName -- all users always "Authorized" (shouldn't be)
Previous Previous
 
Next Next
New Post 3/19/2008 10:02 AM
User is offline Fooberichu
456 posts
www.seeleyware.com
8th Ranked


GetUsersByRoleName -- all users always "Authorized" (shouldn't be) 

I'm trying to get a list of all the authorized users within a certain Role so I'm using DotNetNuke.Security.Roles.RoleController.GetUsersByRolName(portalId, "someRole") and without fail it returns all the users in that role AND shows them all as authorized users even though they are not authorized.  I have tried nulling the Membership (which throws an exception), tried reloading the membership by calling DotNetNuke.Entities.Users.UserController.GetUserMembership(ref userInfo) and it still shows them as authorized.  What's up here?  Alternative code I should use to retrieve this list?

Any suggestions greatly appreciated.  I *could* load up the entire membership list using the UserController.GetUsers(portalId, true) and then iterate those to get the users in the role I want but that isn't too attractive for performance.


-- Fooberichu
http://www.seeleyware.com
 
New Post 3/19/2008 11:57 AM
User is offline Fooberichu
456 posts
www.seeleyware.com
8th Ranked


Re: GetUsersByRoleName -- all users always "Authorized" (shouldn't be) 

Well, I perused the code and found that the difference comes down to a CBO.FillCollection vs the GetUsers function calling interally a FillUserCollection method which takes the "isHydrated" parameter to force hydration or not.  I'm still not sure why when I manually called the GetUserMembership function it still showed them as authorized (probably the default for the membership object?) but whatever.  I changed my code to load up the user list by GetUsers(portalId, true) and then passed that list into a utility method to see if UserInfo.IsInRole("someRole").  That works beautifully and has the pleasant side effect of processing faster because of less return trips to the database.


-- Fooberichu
http://www.seeleyware.com
 
New Post 5/6/2008 2:46 AM
User is offline baldwin
108 posts
www.dnnsun.com
9th Ranked


Re: GetUsersByRoleName -- all users always "Authorized" (shouldn't be) 

but I can retrive the data what I need as follows:

 Private Sub BindEditors()
            dropEditorList.Items.Clear()
            Dim ctlRole As RoleController = New RoleController
            Dim editorsList As ArrayList = ctlRole.GetUsersByRoleName(PortalId, "Editor")
            dropEditorList.DataTextField = "DisplayName"
            dropEditorList.DataValueField = "UserID"
            dropEditorList.DataSource = editorsList
            dropEditorList.DataBind()
End Sub

i just know the methods "GetUsersInRole"  was <Obsolete("This function has been replaced by GetUserRolesByRoleName")>


www.dnnsun.com:The professional provider of DotNetNuke support, skin design and custom module development.
The professional provider of DotNetNuke support, skin design and custom module development.
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  GetUsersByRoleName -- all users always "Authorized" (shouldn't be)
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Adaptive InfoSystems, Inc.
We provide custom programming and various levels of support for DotNetNuke and the .Net framework.
www.aisysweb.com
Multipartner Virtual Data Rooms
The Virtual Data Rooms (VDR) provided by an expert advisor, far from any ordinary software company!, supporting the sellers and their consultants. Multipartner builds and services higly professional Virtual Data Rooms (VDR) specifically tailored to M&A, Real Estate and NPL deals.
www.multipartner.com
DNN SEO
Seablick Consulting specializes in DNN search engine optimization (SEO), DNN consulting, as well as support & training.
seablick.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP