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  |  

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


  Ads  
Iron Speed Designer is a software development tool for building database, reporting, and forms applications for .NET without hand-coding.
 


  Sponsors  

Meet Our Sponsors

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.
SmarterTools
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
 


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
347 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
347 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
96 posts
www.dnnsun.com
10th 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.
Showcase your website Powered by dnn!
Showcase your website Powered by dnn!
 
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.

 


Aricie
Aricie is one of the French pioneers and experts in DotNetNuke technology.
www.aricie.com
AFUEGO!
Looking for Free DNN Hosting?
www.AFUEGO.com
Code 5 Systems, LLC.
The DNN Missing Link: A Form Module. Form Master 1.6 is an intuitive Form Creation Module at a great price. Quality Custom Module development, and DNN consulting services.
www.code5systems.com

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