RE: Disable/remove/hide File Upload options from Documents and Media (7.3v)?

Chanakya P, modified 2 Years ago. Junior Member Posts: 72 Join Date: 2/17/14 Recent Posts

Hi Team,

I want to disable/remove/hide the File Upload option from Documents and Media in control panel.

How to implement this in 7.3 version?

Please provide the suggessions.

Thank you in Advance.

 


 

 

thumbnail
Olaf Kock, modified 3 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts

Control Panel / Site Administration is the place where the full administrative interface lives. You shouldn't modify anything there. If you have a particular user, whom you don't want to give upload permissions, just provide the appropriate permissions/roles for that user and the option will not be shown. You might want to revoke access for either individual operations, or for the whole Site Administration interface - your choice.

​​​​​​​In general, Liferay's administrative UI shows you whatever you have explicit access & permissions to. Look at a role's "Define Permissions" screen and the roles that the user in question has.

Chanakya P, modified 2 Years ago. Junior Member Posts: 72 Join Date: 2/17/14 Recent Posts

I want to hide only file upload but user can see other features(options) like multiple documents, repository and other document types in plus icon. 

Just i want to hide that only one option file upload in plus icon menu.

In Define permission , we don’t have specific action to that single file upload permission. 

Any possibility if we override any service?

thumbnail
Jamie Sammons, modified 3 Years ago. New Member Posts: 8 Join Date: 2/5/14 Recent Posts

We had a similar requirement, as part of an upgrade from 6.2 to 7.3, and we had to keep certain customizations in place (since developed components relied on those design decisions).

The DefaultDLPortletToolbarContributor class contributes the "Multiple File Upload" option.

The way we customized that menu was by extending that class, then using OSGI methods to disable the original programmically when our Service was activated (and enabled when ours was deactivated as well).

This post (https://liferay.dev/ask/questions/development/disable-osgi-component-and-use-custom-one-1) was very helpful (particularly the solutions in the comments), as it described overriding a Service that's used the same way DLPortletToolbarContributors are.

Also, since DefaultDLPortletToolbarContributor is not exported from the document-library-web bundle, we used the technique in  https://liferay.dev/blogs/-/blogs/fixing-module-package-access-modifiers to make that class visible to our module, and thus easier to extend.

Personally, I didn't like having to alter this Menu, but as I said, this was part of an Upgrade where we had to adhere to previous design decisions, and to the customer's expectations.

 

Hope this helps.