DNN Provider 4.0 - Customize Toolbar by Role?

Last post 11-13-2006, 9:16 PM by Adam. 65 replies.
Page 4 of 4 (66 items)   < Previous 1 2 3 4
Sort Posts: Previous Next
  •  11-01-2006, 11:51 PM 23967 in reply to 23966

    Re: DNN Provider 4.0 - Customize Toolbar by Role?

    Hi Adam,

    The problem with your "Programatically specify the ... gallery path" sections is that "~" represents the root of the DNN system - on our install, it's "e:\inetpub\wwwroot\website".  So "~images/" would mean "e:\inetpub\wwwroot\website\images".  However, we want the "~" to be portal specific so that "~images/" would mean "e:\inetpub\wwwroot\website\Portals\2\images".

    I have added code to the Provider code "getSettingByRole()" that does this for me...  Here is the code (I am certain you could write more elegant code, but it's late and I needed to get this done, but hopefully it illustrates what we are trying to accomplish):

                        If Not Directory.Exists(HttpContext.Current.Server.MapPath(Templatefolder)) Then
                            Directory.CreateDirectory(HttpContext.Current.Server.MapPath(Templatefolder))
                        End If


                        ' New code to allow customizations of the Gallery directories using the
                        ' _SecurityPolicyFile
                        Dim sImageGalleryPath As String = tempfolder
                        Dim sFilesGalleryPath As String = tempfolder
                        Dim sMediaGalleryPath As String = tempfolder
                        Dim sFlashGalleryPath As String = tempfolder
                        Dim sTemplateGalleryPath As String = Templatefolder
                        If (_SecurityPolicyFile <> "") Then     ' If a SecurityPolicyFile has been defined
                            Dim oXML As XmlTextReader
                            Dim sPath As String
                            Dim bFound As Boolean
                            oXML = New XmlTextReader(HttpContext.Current.Server.MapPath(cntlCE.FilesPath) _
    & "\Configuration\Security\" & _SecurityPolicyFile)
                            oXML.WhitespaceHandling = WhitespaceHandling.None
                            oXML.Read()
                            While (Not oXML.EOF)
                                bFound = False
                                If (oXML.Name = "security") Then

                                    If (Not bFound And (oXML.GetAttribute("name") = "ImageGalleryPath")) Then
                                        sPath = oXML.ReadElementContentAsString()
                                        sImageGalleryPath = Replace(sPath, "~", tempfolder)
                                        bFound = True
                                    End If
                                    If (Not bFound And (oXML.GetAttribute("name") = "FilesGalleryPath")) Then
                                        sPath = oXML.ReadElementContentAsString()
                                        sFilesGalleryPath = Replace(sPath, "~", tempfolder)
                                        bFound = True
                                    End If
                                    If (Not bFound And (oXML.GetAttribute("name") = "MediaGalleryPath")) Then
                                        sPath = oXML.ReadElementContentAsString()
                                        sMediaGalleryPath = Replace(sPath, "~", tempfolder)
                                        bFound = True
                                    End If
                                    If (Not bFound And (oXML.GetAttribute("name") = "FlashGalleryPath")) Then
                                        sPath = oXML.ReadElementContentAsString()
                                        sFlashGalleryPath = Replace(sPath, "~", tempfolder)
                                        bFound = True
                                    End If
                                    If (Not bFound And (oXML.GetAttribute("name") = "TemplateGalleryPath")) Then
                                        sPath = oXML.ReadElementContentAsString()
                                        sTemplateGalleryPath = Replace(sPath, "~", tempfolder)
                                        bFound = True
                                    End If
                                End If

                                If (Not bFound) Then
                                    oXML.Read()
                                End If
                            End While
                        End If

                        cntlCE.SetSecurityImageGalleryPath(sImageGalleryPath)
                        cntlCE.SetSecurityFilesGalleryPath(sFilesGalleryPath)
                        cntlCE.SetSecurityMediaGalleryPath(sMediaGalleryPath)
                        cntlCE.SetSecurityFlashGalleryPath(sFlashGalleryPath)
                        cntlCE.SetSecurityTemplateGalleryPath(sTemplateGalleryPath)


  •  11-02-2006, 12:11 AM 23970 in reply to 23967

    Re: DNN Provider 4.0 - Customize Toolbar by Role?

    risedev,
     
    Try the steps below:
     
    1. Set UseDNNRootImageDirectory to true.
     
    2. Open CEHtmlEditorProvider.vb and find the following code:
     
                        Dim trim(1) As Char
                        trim(0) = "/"c
                        Dim tempfolder As String = "Guest"
                        Dim Templatefolder As String = ""
                        If role = "Admin" Then
                            tempfolder = ""
                        ElseIf role = "Registered" Then
                            tempfolder = "Member"
                        ElseIf role <> String.Empty Then
                            tempfolder = role
                        End If
                        tempfolder = RootImageDirectory.TrimEnd(trim) & "/" & tempfolder
                        Templatefolder = RootImageDirectory.TrimEnd(trim) & "/templates"
                        Dim phyfolder As String
                        phyfolder = HttpContext.Current.Server.MapPath(tempfolder)
                        If role = "Administrators" Then
                            phyfolder = HttpContext.Current.Server.MapPath(RootImageDirectory.TrimEnd(trim) & "/Admin")
                        End If
                        If Not Directory.Exists(phyfolder) Then
                            Directory.CreateDirectory(phyfolder)
                        End If
                        If Not Directory.Exists(HttpContext.Current.Server.MapPath(Templatefolder)) Then
                            Directory.CreateDirectory(HttpContext.Current.Server.MapPath(Templatefolder))
                        End If
                        cntlCE.SetSecurityImageGalleryPath(tempfolder)
                        cntlCE.SetSecurityFilesGalleryPath(tempfolder)
                        cntlCE.SetSecurityMediaGalleryPath(tempfolder)
                        cntlCE.SetSecurityFlashGalleryPath(tempfolder)
                        cntlCE.SetSecurityTemplateGalleryPath(Templatefolder)
     
     And change it to:
      
                      Dim trim(1) As Char
                        trim(0) = "/"c
                        Dim tempfolder As String = "Images"
                        Dim Templatefolder As String = ""
                        If role = "Admin" Then
                            tempfolder = ""
                        ElseIf role = "Registered" Then
                            tempfolder = "Member"
                        ElseIf role <> String.Empty Then
                            tempfolder = role
                        End If
                        tempfolder = RootImageDirectory.TrimEnd(trim) & "/" & tempfolder
                        Templatefolder = RootImageDirectory.TrimEnd(trim) & "/templates"
                        Dim phyfolder As String
                        phyfolder = HttpContext.Current.Server.MapPath(tempfolder)
                        If role = "Administrators" Then
                            phyfolder = HttpContext.Current.Server.MapPath(RootImageDirectory.TrimEnd(trim) & "/Admin")
                        End If
                        If Not Directory.Exists(phyfolder) Then
                            Directory.CreateDirectory(phyfolder)
                        End If
                        If Not Directory.Exists(HttpContext.Current.Server.MapPath(Templatefolder)) Then
                            Directory.CreateDirectory(HttpContext.Current.Server.MapPath(Templatefolder))
                        End If
                        cntlCE.SetSecurityImageGalleryPath(tempfolder)
                        cntlCE.SetSecurityFilesGalleryPath(tempfolder)
                        cntlCE.SetSecurityMediaGalleryPath(tempfolder)
                        cntlCE.SetSecurityFlashGalleryPath(tempfolder)
                        cntlCE.SetSecurityTemplateGalleryPath(Templatefolder)
     
    This will resolve the problem.
     

    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

  •  11-10-2006, 4:40 PM 24242 in reply to 23970

    Re: DNN Provider 4.0 - Customize Toolbar by Role?

    I've been trying to follow this thread and I may of missed the answer, but is there a way to without adjusting the web.config for every role to enable roles to only see/upload to a specific folder?
     
    For example, I have multiple authors and within File Manager I create a folder for them, create a role for that specific user and assign that role to the folder with write permissions.  So when they use FTB they can only see/upload items to their folder.
     
    Can CuteEditor provide this same functionality?  If I had only a handful of authors, I wouldn't mind customizing the web.config or the Admin.config or creating custom security files.
     
    If this is possible can you please direct me on how I can do this?  THe reason I'm inquiring about this is, i'm developing multiple sites and designating a person at each site to maintain their authors, so I need a webpage interface that these 'admins' can create a 'work space' for these authors.
     
    I really like the functionality that this editor offers so I hope there is some kind of workaround for this.  This editor seems to be the only one that works as advertised on MAC/PC.  Which is important to me because I work for a school system.
     
     
    Thanks
     
    Jerry
  •  11-11-2006, 12:46 AM 24247 in reply to 24242

    Re: DNN Provider 4.0 - Customize Toolbar by Role?

    Jerrry,
     
    Yes.
     
    Do your authors belong to admin role or another role?
     
    Please check the Case 2 in the following thread:
     
     
    Keep me posted
     

    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

  •  11-13-2006, 9:58 AM 24277 in reply to 24247

    Re: DNN Provider 4.0 - Customize Toolbar by Role?

    Hi,
     
    I create a custom role.  Then assign 1 specific person to that role.  I then assign that role to specific part of the website.  I also assign that role to a specific folder with r/w so that they have their own folder to store their files related to their part of the website.
     
    I'm trying to create a school site and creating pages for staff in which they only have rights to edit their part of the website.
     
    I hope this helps to explain what I'm trying to do.
     
    Thanks for you help
     
    Jerry.
  •  11-13-2006, 9:16 PM 24301 in reply to 24277

    Re: DNN Provider 4.0 - Customize Toolbar by Role?

    Jerry,
     
    >>but is there a way to without adjusting the web.config for every role to enable roles to only see/upload to a specific folder?
     
    For your situation, you need to modify the web.config file and add the custom security setting for your custom role. Another solution is modifying the provider project and recompile the project.
     
    How to add security settting for a custom role?
     
    Let us assume your custom role name is: Author.
     
    Just copy the following code into the web.config file.
     

         Author_AutoConfigure = "Full"
         Author_SecurityPolicyFile = "admin.config"
         Author_TemplateItemList = ""
         Author_DisableItemList = ""
         Author_AllowPasteHtml  ="true"
         Author_EditorOnPaste  = "default"
         Author_ReadOnly = "false"
         Author_ShowBottomBar ="true"
         Author_ShowHtmlMode  ="true"
         Author_ShowPreviewMode  ="true"
         Author_EnableStripScriptTags  ="false" 
         Author_EnableContextMenu    ="true"  
         Author_EnableContextMenuEditing  = "true"  
         Author_EnableContextMenuFormat   = "true"
         Author_EnableContextMenuInsert  = "true"
         Author_EnableContextMenuInsertAdvanced  = "true"
         Author_EnableContextMenuInsertFiles = "true"
         Author_EnableContextMenuInsertForms = "true"
         Author_EnableContextMenuRelative = "true"
         Author_EnableContextMenuTags = "true"
         Author_EnableContextMenuVerbs = "true"
     
    Please note that in the above code the security policy file used by "Author" is the admin.config.
     
    You can easiy create a custom security policy file and assign it to "Author".
     
    Hope it helps.
     

    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

Page 4 of 4 (66 items)   < Previous 1 2 3 4
View as RSS news feed in XML