Programmatic access to configuration security settings

Last post 07-18-2008, 2:11 PM by Adam. 1 replies.
Sort Posts: Previous Next
  •  07-18-2008, 8:28 AM 42344

    Programmatic access to configuration security settings

    Is there anyway for a chosen security role (Admin, Default etc) to get access to the key/value pair?
     
    EG in the admin.config file get at the value for key MaxFlashSize from code behind, so that I can enforce those rules elsewhere in code that doesn't use the editor directly.
     
    Any built in classes/methods/properties that I can access without resorting to manually process the config file myself?
  •  07-18-2008, 2:11 PM 42353 in reply to 42344

    Re: Programmatic access to configuration security settings

    Here is an example:
     
    //use the app-based path 

    Editor1.Setting["security:ImageGalleryPath"]= "~/uploads";
    //use the absolute path 
    Editor1.Setting["security:ImageGalleryPath"]= "/uploads";
    //use the physical path 
    Editor1.Setting["security:ImageGalleryPath"]= @"c:\inetpub\wwwroot\uploads";
    or
    //use the app-based path 

    Editor1.SetSecurityImageGalleryPath("~/uploads");
    //use the absolute path 
    Editor1.SetSecurityImageGalleryPath("/uploads");
    //use the physical path 
    Editor1.SetSecurityImageGalleryPath("c:\inetpub\wwwroot\uploads");


    VB Example:

    //use the app-based path 

    Editor1.Setting("security:ImageGalleryPath")= "~/uploads"
    //use the absolute path 
    Editor1.Setting("security:ImageGalleryPath")= "/uploads"
    //use the physical path 
    Editor1.Setting("security:ImageGalleryPath")= "c:\inetpub\wwwroot\uploads" 
    or
    //use the app-based path 

    Editor1.SetSecurityImageGalleryPath("~/uploads")
    //use the absolute path 
    Editor1.SetSecurityImageGalleryPath("/uploads")
    //use the physical path 
    Editor1.SetSecurityImageGalleryPath("c:\inetpub\wwwroot\uploads") 

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML