Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Path Finder LifeRay
delete download link Documents and media library
September 14, 2012 9:09 AM
Answer

Path Finder LifeRay

Rank: Expert

Posts: 262

Join Date: September 18, 2009

Recent Posts

Hi All,

i'm using liferay6.1 version... here's my question?

how to delete/disable download link for the files that i have uploaded in the documents and media library..
specifically...

i have uploaded a document in D/M Library portlet for guest role i have kept the view permission now the download link is active here.

how to remove the download link for the D/M library portlet.


regards
path
Alireza Zare
RE: delete download link Documents and media library
September 15, 2012 2:40 PM
Answer

Alireza Zare

Rank: Regular Member

Posts: 110

Join Date: September 3, 2010

Recent Posts

If you mean the download url next to WebDAV url, you can just do it by hooking the view_file_entry.jsp in ROOT\html\portlet\document_library.
Path Finder LifeRay
RE: delete download link Documents and media library
June 29, 2013 1:08 AM
Answer

Path Finder LifeRay

Rank: Expert

Posts: 262

Join Date: September 18, 2009

Recent Posts

Hi All,

Ples find the screen shot. i'm i have uploaded a document in the document and media library and i have given user only view permissions.

but still download button appears when i click the document.

how to delete the download link for a particular user based on permissions and roles.

please let me know

regards
path finder.
Attachments: download.bmp (2,304.1k)
Antoine Comble
RE: delete download link Documents and media library
June 29, 2013 4:48 AM
Answer

Antoine Comble

Rank: Regular Member

Posts: 226

Join Date: September 7, 2012

Recent Posts

Hi,

You just have to hook the document and media library portlet as describe in previous post.

Antoine
Path Finder LifeRay
RE: delete download link Documents and media library
June 30, 2013 11:02 PM
Answer

Path Finder LifeRay

Rank: Expert

Posts: 262

Join Date: September 18, 2009

Recent Posts

Antoine Comble:
Hi,

You just have to hook the document and media library portlet as describe in previous post.

Antoine


Hi Antoine,

here's the requirement ...... a user is only able to view the document. He is not able to save, copy or do anything else with that document.

Can we do that by hooking... if so how to configure it to a particular user?...also for some users i need to enable download link and for some it should be disabled....it is not the link i'm talking both the link and download button that appears on top of document should be disabled..

please help in this....

Thanks
Path Finder LifeRay
RE: delete download link Documents and media library
June 30, 2013 11:23 PM
Answer

Path Finder LifeRay

Rank: Expert

Posts: 262

Join Date: September 18, 2009

Recent Posts

Hi All,

can't we do this with the roles and permissions given by liferay default..

Thanks.
Antoine Comble
RE: delete download link Documents and media library
July 1, 2013 12:51 AM
Answer

Antoine Comble

Rank: Regular Member

Posts: 226

Join Date: September 7, 2012

Recent Posts

Hi,

That you cant do is not possible in Liferay : http://jira.portletfaces.org/browse/LPS-33944?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel.

But, you can create 1 role can download document and assign wanted users to this role.

After doing this, you override file_entry_action.jsp and edit this block :
1
2<c:if test="<%= DLFileShortcutPermission.contains(permissionChecker, fileShortcut, ActionKeys.VIEW) %>">
3                    <liferay-ui:icon
4                        image="download"
5                        message='<%= LanguageUtil.get(pageContext, "download") + " (" + TextFormatter.formatKB(fileEntry.getSize(), locale) + "k)" %>'
6                        url='<%= themeDisplay.getPortalURL() + themeDisplay.getPathContext() + "/documents/" + fileShortcut.getFileShortcutId() %>'
7                    />
8                </c:if>


Change the if condition with your own condition to search if user has role can download to display the button.

Hope this help you,

Antoine
Manish Yadav
RE: delete download link Documents and media library
July 1, 2013 1:48 AM
Answer

Manish Yadav

Rank: Expert

Posts: 449

Join Date: May 26, 2012

Recent Posts

Path Finder LifeRay:
Hi All,

can't we do this with the roles and permissions given by liferay default..

Thanks.


you can disable or delete download link using hook .if you want to show for specific role then use permissionchecker

1\html\portlet\document_library\view_file_entry.jsp