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  
Iron Speed Designer is a software development tool for building database, reporting, and forms applications for .NET without hand-coding.
 


  Sponsors  

Meet Our Sponsors

CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
SteadyRain
DataSprings - Great Ideas. Always Flowing.
 


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.

 


Expressnet - DotNetNuke Hosting
Expressnet provide premium quality ASP.NET Web Hosting. We specialise in Windows based products including ASP.NET and Microsoft SQL Server. We offer fantastic value packages for DotNetNuke hosting. We also offer free asp.net web hosting
www.expressnet.com.au
Softech Development, Inc.
We help your business work smarter with DotNetNuke. Whether you need a new implementation, a custom module or skin for an existing implementation, or integration with your business processes, Softech has the experience and expertise to make it happen.
www.softechdevelopment.com
Module Development by Engage Software
Specializing in custom module development, training and skinning.
www.engagesoftware.com

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