I want to hide version download link for consumers. Please let me know what needs to be done in order to hide the link.
Could you provide a more detailed description of what you're trying to achieve? There are lots of places/pages in which a download appears? You refer to "version" download - so I would assume that you want to hide a button or buttons on the document details page in the "Version History" section - is this correct?
Yes, I want to hide the download link available in the version history
section. I have to hide the link for users with consumer role. I am trying
to override the document-versions.js file's function
function DocumentVersions_getDocumentVersionMarkup(doc)*." I am calling the
membership webscript to check the role of the user "*var json =
remote.call("/api/sites/" + page.url.templateArgs.site + "/memberships/" +
encodeURIComponent(user.name <http://user.name>));*" and hide the link if
the user role is SiteConsumer.
Is this correct ??
Sr. Software Engineer
Mobile: +91 9899586608
Email: firstname.lastname@example.org <email@example.com>
Yes, I would say that this looks to be the correct approach. Is it not working?
I can see an error ""Uncaught ReferenceError: remote is not defined ."
Can you please let me know where I am going wrong ?
I am getting an error while customizing docuement-versions.js
file's getDocumentVersionMarkup: function
DocumentVersions_getDocumentVersionMarkup(doc) method. In this I am getting
response object as null but I can see in the developer console that my
membership webscript is returning the desired result. can you please help
Here is my custom code - http://pastebin.com/ABQ8BubJ
On first inspection it looks like the problem you have is that you're treating an asynchronous request as being synchronous... so you make the call to Alfresco.util.Ajax.jsonGet and then immediately continue the processing and try to reference the variable "json" before the XHR request has completed and set it - this is why it's being reported as null. The XHR request does successfully complete, but not until after you've tried to reference "json".
The basic principal is exactly the same, except that instead of extending the documentlist.get.js controller you're extending the document-versions.get.js controller and instead of extending the Alfresco.DocumentList widget you're extending the Alfresco.DocumentVersions widget and instead of overriding the onFilterChanged function you're overriding the getDocumentVersionMarkup function.
Retrieving data ...