Forums de discussion

delete download link Documents and media library

thumbnail
Path Finder LifeRay, modifié il y a 11 années.

delete download link Documents and media library

Expert Publications: 262 Date d'inscription: 18/09/09 Publications récentes
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, modifié il y a 11 années.

RE: delete download link Documents and media library

Regular Member Publications: 110 Date d'inscription: 03/09/10 Publications récentes
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, modifié il y a 10 années.

RE: delete download link Documents and media library

Expert Publications: 262 Date d'inscription: 18/09/09 Publications récentes
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.

Pièces jointes:

thumbnail
Antoine Comble, modifié il y a 10 années.

RE: delete download link Documents and media library

Regular Member Publications: 232 Date d'inscription: 07/09/12 Publications récentes
Hi,

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

Antoine
thumbnail
Path Finder LifeRay, modifié il y a 10 années.

RE: delete download link Documents and media library

Expert Publications: 262 Date d'inscription: 18/09/09 Publications récentes
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, modifié il y a 10 années.

RE: delete download link Documents and media library

Expert Publications: 262 Date d'inscription: 18/09/09 Publications récentes
Hi All,

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

Thanks.
thumbnail
Antoine Comble, modifié il y a 10 années.

RE: delete download link Documents and media library

Regular Member Publications: 232 Date d'inscription: 07/09/12 Publications récentes
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, modifié il y a 10 années.

RE: delete download link Documents and media library

Expert Publications: 493 Date d'inscription: 26/05/12 Publications récentes
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