Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: RE: Disable/remove/hide File Upload options from Documents and Media (7.3v)?
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.
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.
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?
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.
Powered by Liferay™