Foros de discusión

delete download link Documents and media library

thumbnail
Path Finder LifeRay, modificado hace 11 años.

delete download link Documents and media library

Expert Mensajes: 262 Fecha de incorporación: 18/09/09 Mensajes recientes
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
thumbnail
Alireza Zare, modificado hace 11 años.

RE: delete download link Documents and media library

Regular Member Mensajes: 110 Fecha de incorporación: 3/09/10 Mensajes recientes
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.
thumbnail
Path Finder LifeRay, modificado hace 10 años.

RE: delete download link Documents and media library

Expert Mensajes: 262 Fecha de incorporación: 18/09/09 Mensajes recientes
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.

Archivos adjuntos:

thumbnail
Antoine Comble, modificado hace 10 años.

RE: delete download link Documents and media library

Regular Member Mensajes: 232 Fecha de incorporación: 7/09/12 Mensajes recientes
Hi,

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

Antoine
thumbnail
Path Finder LifeRay, modificado hace 10 años.

RE: delete download link Documents and media library

Expert Mensajes: 262 Fecha de incorporación: 18/09/09 Mensajes recientes
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
thumbnail
Path Finder LifeRay, modificado hace 10 años.

RE: delete download link Documents and media library

Expert Mensajes: 262 Fecha de incorporación: 18/09/09 Mensajes recientes
Hi All,

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

Thanks.
thumbnail
Antoine Comble, modificado hace 10 años.

RE: delete download link Documents and media library

Regular Member Mensajes: 232 Fecha de incorporación: 7/09/12 Mensajes recientes
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 :

<c:if test="<%= DLFileShortcutPermission.contains(permissionChecker, fileShortcut, ActionKeys.VIEW) %>">
					<liferay-ui:icon image="download" message="<%= LanguageUtil.get(pageContext, &quot;download&quot;) + &quot; (&quot; + TextFormatter.formatKB(fileEntry.getSize(), locale) + &quot;k)&quot; %>" url="<%= themeDisplay.getPortalURL() + themeDisplay.getPathContext() + &quot;/documents/&quot; + fileShortcut.getFileShortcutId() %>" />
				</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
thumbnail
Manish Yadav, modificado hace 10 años.

RE: delete download link Documents and media library

Expert Mensajes: 493 Fecha de incorporación: 26/05/12 Mensajes recientes
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

\html\portlet\document_library\view_file_entry.jsp