Saturday, November 29, 2014
 
   
 
O-DL: disable folder add permission when allowing a role/user to upload documents   Minimize
Location: BlogsOpenDNN blogOpen-DocumentLibrary    
Posted by: Xepient Solutions 2/6/2008
By default, O-DL grants ADD folder permissions when you grant Add Document permissions. Here is an explanation of why, and how to modify this behavior.

There is an explanation as to  why ticking Add Docs will also get you Add Folders permissions.  

This is so because O-DL allows you to add .zip files and unzip them.  These .zip files can contain directory structures as well as documents.  When a directory structure Is found, it is re-created under the folder you are uploading the .zip to.  So, in order to enable unzipping of folders, we have to give add folder rights.

If you wanted to disable this behaviour, you'd have to modify  the javascript that regulates it.


The file that has the JS is found here:
DesktopModules/XSDocumentLibrary/JavaScripts/xsutils.js



The original javascript function is this:

function addDocCheck(oThis,sViewId, sAddId, sEditDocId) {
        if(oThis.checked){
                document.getElementById(sViewId).checked=true;
                document.getElementById(sAddId).checked=true;
                if (document.getElementById(sEditDocId) != null) document.getElementById(sEditDocId).checked=true;
}




You would have to modify it like this:


function addDocCheck(oThis,sViewId, sAddId, sEditDocId) {
        if(oThis.checked){
                document.getElementById(sViewId).checked=true;
                document.getElementById(sAddId).checked=true;

               
/*comment out the following line */
                /*if (document.getElementById(sEditDocId) != null) document.getElementById(sEditDocId).checked=true;*/
}



You should also disable the unzip functionality in the upload pane.

you can do so by setting the unzip checkbox attribute of the chxDocumentUnzip enabled=false in the

DesktopModules/XSDocumentLibrary/Components/FileUploader/XSFileUploader.ascx file

<asp:CheckBox ID="chxDocumentOverwrite" Runat="server" Checked="true" class="xsBox95" enabled="false"></asp:CheckBox>


Permalink |  Trackback

Comments (5)  
Re: O-DL: disable folder add permission when allowing a role/user to upload documents    By Michael Washington on 3/5/2008
To get the behavior I desired (to allow a person to add a document but not have the ability to add a folder) I had to also comment out the line: document.getElementById(sAddId).checked=true;

Re: O-DL: disable folder add permission when allowing a role/user to upload documents    By edi on 5/15/2008
for me removing permissions worked fine but I wanted to remove the entry in the submenu (add sub-folder aswell). I managed this by a quite dirty hack but it worked fine for me. The following had to be changed:<br><br>function addItem(key, capt, url, ico, enb) {<br> var intKey = this.mId+"_"+key;<br> var it = new NlsCtxMenuItem(key, capt, url, ico, enb);<br> // do not add item with the name "sub-folder" in it<br> if (it.capt.toString().indexOf("sub-folder", 0) > 0) return;<br> it.intKey = intKey; <br> this.items[intKey] = it;<br> this.count++;<br>}

Re: O-DL: disable folder add permission when allowing a role/user to upload documents    By idsMarketing on 1/15/2010
I am logged in as the Admin. When trying to upload Zip files, the "Unzip File" check box is not enabled, I would like to enable it. <br><br>This is the code that is found in the DesktopModules/XSDocumentLibrary/Components/FileUploader/XSFileUploader.ascx file:<br><asp:CheckBox ID="chxDocumentUnzip" Runat="server" class="xsBox95" Enabled="true"></asp:CheckBox><br><xs:xshelp id="hlpDocumentOverwrite" runat="server" CssClass="Normal"></xs:xshelp><br>I have added Enabled="true", but still do not have the option to unzip file when uploading. <br><br>In the DesktopModules/XSDocumentLibrary/JavaScripts/xsutils.js<br> file, my code is displayed as:<br><br>function addCheck(oThis, sViewId, sAddDocId) {<br> if(oThis.checked){document.getElementById(sViewId).checked = true;}<br> if(!oThis.checked){if (document.getElementById(sAddDocId) != null) document.getElementById(sAddDocId).checked = false;}<br>}<br><br>function editCheck(oThis, sViewId, sChangeSecurityId) {<br> if(oThis.checked){document.getElementById(sViewId).checked = true;}<br> if(!oThis.checked){document.getElementById(sChangeSecurityId).checked=false;}<br>}<br><br>function deleteCheck(oThis, sViewId) {<br> if(oThis.checked){document.getElementById(sViewId).checked = true;}<br>}<br><br><br>What code is incorrect to enable the "Unzip File" functionality?

Re: O-DL: disable folder add permission when allowing a role/user to upload documents    By host on 1/15/2010
Hello idsMarketing, &lt;br&gt;the ability to unzip files is always available, unless the folder is Moderated. In that case, only individual files are uploadable. This is so that the review process (moderation) may take place. Please check that you have not enabled the moderation option.<br><br>This behavior is by design.&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Xepient

Re: O-DL: disable folder add permission when allowing a role/user to upload documents    By idsMarketing on 1/15/2010
Thank you. You are right. I had set the folder to be "moderated". Once I changed that setting the Unzip Files functionality became available again.

     
Search the Blog   Minimize
     
Blog List   Minimize
     
Blog Archive   Minimize