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  |  

telerik -- supercharge your DNN websites
  Ads  
Webhost4Life - $4.95 Windows Hosting
 


  Sponsors  

Meet Our Sponsors

MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  How to test whether the current user belongs to certain role
Previous Previous
 
Next Next
New Post 1/25/2006 9:25 AM
User is offline Pablo Fridlender
11 posts
10th Ranked


How to test whether the current user belongs to certain role 

Hi,

what I need is really simple: I have a checkbox in the <module>Edit.ascx that I want to make it visible (or hide it) depending on whether the logged user belongs to a certain role or not (i.e. Administrators).

I'm a newbie developing DNN modules, so I don't really have a clue on how to check it.

Thanks in advance!

Pablo.

 
New Post 1/25/2006 11:26 AM
User is offline cathal connolly
2756 posts
www.cathal.co.uk
5th Ranked










Re: How to test whether the current user belongs to certain role 

you want to use the portalsecurity class, and the isinroles method, which accepts a rolename as a string e.g.

Imports DotNetNuke.Security

If PortalSecurity.IsInRoles(roles) Then
                    chkBox.visible=true
                Else
                    chkBox.visible=false

                End If

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  How to test whether the current user belongs to certain role
 


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