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.0Detecting if Detecting if 'host' user is administrator?
Previous
 
Next
New Post
3/7/2007 10:32 AM
 

My module implements custom security in certain sections. I noticed that RoleController.GetUsersInRole(0,"Administrators") does not return the 'host' user in the result set.

If someone is logged in as host, how do I detect that they are allowed full access?


 
New Post
3/7/2007 2:51 PM
 

By definition the Host User (in dnn) has access to everything and is not part of any role.

If you are using core methods - for instance PortalSecurity.IsInRole, User.IsInRole, PortalSecurity.IsInRoles, these methods will automatically return true for the host user.

So PortalSecurity.IsInRole("Administrators") will return true for both a superuser and any user in the Administrators role.

Also you can detect if the current user is a superuser (to do your own security checks) by UserInfo.IsSuperUser, where UserInfo is the current user (a proeprty od PortalModuelBase).


Charles Nurse
Chief Architect
Evoq Content Team Lead,
DNN Corp.

Want to contribute to the Platform project? - See here
MVP (ASP.NET) and
ASPInsiders Member
View my profile on LinkedIn
 
New Post
6/6/2007 1:29 AM
 

I'm interested to know if you can give a user page edit permissions without giving them access to the control panel. For instance, I am using Catalook and DNN 4.3.2. And when you are logged in as admin or host you can browse the site and edit products as you go. Supposedly you can give a user permission to access the category and module in Catalook as well as page edit permissions in DNN. The only way I can get a user to have the edit buttons under the products is to give page edit permissions. But the user doesn't need to be playing around with the page layout or adding modules. That's my job. Any suggestions?

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Detecting if Detecting if 'host' user is administrator?


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