Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Hot to tell if the logged on user has Edit Rights on a pageHot to tell if the logged on user has Edit Rights on a page
Previous
 
Next
New Post
2/7/2007 5:59 AM
 
Hi,

I need to check if the logged on user is in a role that has edit rights on a page:

I was using the SuperUser check -
if (UserController.GetCurrentUserInfo().IsSuperUser)

and the Admin role check
if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString()))

but how do I check if they are neither Admin nor a SuperUser, and yet they have a role with the right to edit the page? I could iterate through each of the users role, but is there a convenient method or property I could just use?

Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
2/7/2007 6:18 AM
 
Nevermind - think I got it:
PortalSecurity.IsInRoles(PortalSettings.ActiveTab.AdministratorRoles.ToString)

Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
2/7/2007 6:25 AM
 
Actually, this leads me to another question...

What's the difference between:
PortalSettings.ActiveTab.AdministratorRoles.ToString()
and
PortalSettings.ActiveTab.AuthorizedRoles.ToString()

There are 2 shipped rights - View and Edit - how do these tie into these properties? Which one property do I need to determine if the user has Edit rights on the page?

Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
2/7/2007 10:09 AM
 
If you want to check for Edit permissions in a module I think the better call to make is PortalSecurity.HasEditPermissions(ModuleId, TabId).  Many roles other than administrators could be editors.
 
New Post
2/7/2007 10:11 AM
 
I am not 100% sure on this but my guess is that administratorRoles relates to edit rights as they can chang ethe module and are essentially administrators.  The AuthorizedRoles relates to those that are authorized to view the current page.

-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Hot to tell if the logged on user has Edit Rights on a pageHot to tell if the logged on user has Edit Rights on a page


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out