cancel
Showing results for 
Search instead for 
Did you mean: 

Disable rename option in repository

krzysztofnowack
Champ in-the-making
Champ in-the-making
Hi,

Is it possible to disable the "Rename" option in repository without changing the permissions on a folder/document?

[img]http://imageshack.us/a/img259/2510/80050345.png[/img]

[img]http://imageshack.us/a/img832/839/73513459.png[/img]
7 REPLIES 7

lementree
Champ on-the-rise
Champ on-the-rise
Yes,
You can disable this behaviuor in webapps/share/components/documentlibraray/doclist.js.

krzysztofnowack
Champ in-the-making
Champ in-the-making
Thanks for your help Smiley Happy

Solution:

In file: webapps/share/components/documentlibraray/documentlist.js remove this code:

            if (jsNode.hasPermission("Write") && !jsNode.isLocked)
            {
               scope.insituEditors.push(
               {
                  context: filenameId,
                  params:
                  {
                     type: "textBox",
                     nodeRef: jsNode.nodeRef.toString(),
                     name: "prop_cm_name",
                     value: record.fileName,
                     fnSelect: function fnSelect(elInput, value)
                     {
                        // If the file has an extension, omit it from the edit selection
                        var extnPos = value.lastIndexOf(Alfresco.util.getFileExtension(value)) - 1;
                        if (extnPos > 0)
                        {
                           Alfresco.util.selectText(elInput, 0, extnPos);
                        }
                        else
                        {
                           elInput.select();
                        }
                     },
                     validations: [
                     {
                        type: Alfresco.forms.validation.nodeName,
                        when: "keyup",
                        message: scope.msg("validation-hint.nodeName")
                     },
                     {
                        type: Alfresco.forms.validation.length,
                        args: { min: 1, max: 255, crop: true },
                        when: "keyup",
                        message: scope.msg("validation-hint.length.min.max", 1, 255)
                     }],
                     title: scope.msg("tip.insitu-rename"),
                     errorMessage: scope.msg("message.insitu-edit.name.failure")
                  },
                  callback:
                  {
                     fn: scope._insituCallback,
                     scope: scope,
                     obj: record
                  }
               });
            }

Hello,

I tried commenting the code in documentlist.js like says Krzysztof but still can rename.

Im using alfresco 4.2 do you know if is necesary to remove something else?

pintureti
Star Contributor
Star Contributor

I have the same issue, version 5. I have delete this code, but still can rename.

Thanks in advance.

douglascrp
World-Class Innovator
World-Class Innovator

Have you recreated the -min.js version of that file?

pintureti
Star Contributor
Star Contributor

Sorry, I don´t understand.Can you explain it?

Thanks

pintureti
Star Contributor
Star Contributor

I have use to do it firefox, + firebug, done.

thanks