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  |  

AspDotNetStoreFront
  Ads  
 


  Sponsors  

Meet Our Sponsors

telerik
ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  User Defined Ta...  GetPortalSettings? I dont get it...
Previous Previous
 
Next Next
New Post 6/19/2008 4:01 PM
User is offline Corey
20 posts
10th Ranked


GetPortalSettings? I dont get it... 

I'm looking into putting custom permissions into my module and was researching the UDT's module security page in the source. In it they have what looks like a method or something named GetPortalSettings.

hasGeneralEditPermissions = PortalSecurity.IsInRole(GetPortalSettings.AdministratorRoleName) _
Or PortalSecurity.HasEditPermissions(moduleId)

I dont understand. I can find no references to this in the module source or on the web. Shouldn't GetPortalSettings.AdministratorRoleName be PortalSettings.AdministratorRoleName? When I try to experiment with this stuff It cant find reference to GetPortalSettings and when I do the norm and use PortalSettings, I get "An object reference is required......"

I'm still pretty new at .Net and DNN and I'm trying to learn VB and C# at the same time. Any help?

 
New Post 6/20/2008 6:59 AM
User is offline Stefan Cullmann
1553 posts
5th Ranked








Re: GetPortalSettings? I dont get it... 

PortalSettings is a class type and AdministratorRoleName is a property of it. You will need an instance of PortalSettings to access that property. Modules inherit from PortalModulbase, which has a Property PortalSettings of type PortalSettings, and this property is set when the module gets injected.

The code you are showing resides in its own class ModuleSecurity. ModuleSecurity  is not aware of the current context, it has no property or field PortalSettings. Luckily the DNN framework offers some libraries to support the developper. DotNetNuke.Common.Globals is a vb.module that contains a public function GetPortalSettings(), which returns an instance of the current PortalSettings.

Hint: make a right click on unknown objects inside Visual Studio and choose "Go to Definition".


Stefan Cullmann - stefan.cullmann [at] dotnetnuke.com
form and List will be the successor of the User Defined Table module.
----------------------------------------------------------------------
Do you want to import external data to form and List /User Defined Table?
Check out http://www.codeplex.com/Csv2UDTImport
 
New Post 6/20/2008 7:28 AM
User is offline Corey
20 posts
10th Ranked


Re: GetPortalSettings? I dont get it... 

Ok. I think I understand that, but what is the GetPortalSettings used in ModuleSecurity? Where is it referenced at? Its being used several times when looking for the AdministratorRoleName but I don't see it created anywhere.

I'm sorry I'm still a bit confused.

 
New Post 6/22/2008 4:19 AM
User is offline Stefan Cullmann
1553 posts
5th Ranked








Re: GetPortalSettings? I dont get it... 
Modified By Stefan Cullmann  on 6/22/2008 8:07:40 AM)

VB allows to be lazy: GetPortalSettings.AdminstratorRoleName is the same as GetPortalSettings().AdministratorRoleName is the same as 
DotNetNuke.Common.Globals.GetPortalSettings().AdministratorRoleName .

As Globals is a VB module, it extends the set of available function and procedures. C# doesn't have a similar concept, you can not write this kind of libraries in C#. 


Stefan Cullmann - stefan.cullmann [at] dotnetnuke.com
form and List will be the successor of the User Defined Table module.
----------------------------------------------------------------------
Do you want to import external data to form and List /User Defined Table?
Check out http://www.codeplex.com/Csv2UDTImport
 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  User Defined Ta...  GetPortalSettings? I dont get it...
 


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.

 


Smart-Thinker
DNN Modules for Social Networks for as low as $69 for 6 modules! We also maintain the DotNetNuke Directory - http://DNNDir.com
www.smart-thinker.com
DNN Photo Gallery
Complete Photo Gallery Management!
www.dnnPhotoGallery.com
R2i - Delivering Serious DNN Services & Solutions
Award Winning Design, Skin construction, Custom Modules and Consulting Services for the Enterprise organization. R2i is the DNN:Map module Project Lead and one of the largest DNN service providers with offices in New York City, Virginia and Baltimore.
www.bi4ce.com

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