Expand my Community achievements bar.

SOLVED

How to disable/hide Quick publish option for PDF assets in asset manager

Avatar

Level 2

Hi All,

I have a use case where we have to hide/disable the "Quick Publish" option from the console in asset manager. our use case is all the pdf assets has to go through the workflow approval process for publishing.

Thanks in advance.

Regards,
Anudeep

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi @Anudeep_Kumar ,

You are adding the expression inside the render condition, you'll need to create a new node similar to other nodes like main asset and not and add these details over there. 

ayushmishra07_0-1689715552798.png


Validated this with PDF works well. 

PS :- You'll need to overlay the assetdetails component in place of asset component as this solution will work on the assetdetails page because that's where the url i.e requestPathInfo includes the file path. 

eg : URL of assetdetails : http://localhost:7502/assetdetails.html/content/dam/pwa/sample.pdf


If you want to achieve the functionality on assetdetails page as well as asset page, you can hide the quick publish feature completely from assets page by removing it from the overlaid component, that'll mean that user can publish an asset only from the assetdetails page and on the assetdetails page you can add this render condition to hide it, if your file is of PDF format.

View solution in original post

9 Replies

Avatar

Community Advisor

Hello @Anudeep_Kumar 

 

It can be achieved via granite:renderCondition. If we validate the URL of the asset, that it should not end with ".pdf"

 

 

 <granite:rendercondition
      jcr:primaryType="nt:unstructured"            
      sling:resourceType="granite/ui/components/coral/foundation/renderconditions/simple"
      expression="${!granite:containsIgnoreCase(requestPathInfo.suffix, '.pdf')}"/>

 


Aanchal Sikka

Avatar

Employee

Hi @Anudeep_Kumar ,

Adding to the solution.
The "Quick Publish" tab is present at two places : 
1 - at asset.html screen 

ayushmishra07_0-1689683585374.png

2 - at assetdetails.html 

ayushmishra07_1-1689683635678.png

In order to hide it from both the screens you'll need to overlay the following two nodes in your project : 

1 - /libs/dam/gui/content/assets/jcr:content/actions/selection/quickpublish

2 - /libs/dam/gui/content/assetdetails/jcr:content/actions/quickpublish 

You can do that by creating similar folder structures inside /apps/dam.

Then in the content.xml file of the quickpublish nodes you'll need to put the rendercondition as shared  already by @aanchal-sikka .

Hope it helps !

Thanks,
Ayush

Avatar

Level 2

Hi @ayushmishra07 ,
Thanks for the solution, I have tried overlaying the same from /libs but I could not be able to hide it. Please find the screenshot for the reference, let me know if I have missed anything
1render.png

Avatar

Correct answer by
Employee

Hi @Anudeep_Kumar ,

You are adding the expression inside the render condition, you'll need to create a new node similar to other nodes like main asset and not and add these details over there. 

ayushmishra07_0-1689715552798.png


Validated this with PDF works well. 

PS :- You'll need to overlay the assetdetails component in place of asset component as this solution will work on the assetdetails page because that's where the url i.e requestPathInfo includes the file path. 

eg : URL of assetdetails : http://localhost:7502/assetdetails.html/content/dam/pwa/sample.pdf


If you want to achieve the functionality on assetdetails page as well as asset page, you can hide the quick publish feature completely from assets page by removing it from the overlaid component, that'll mean that user can publish an asset only from the assetdetails page and on the assetdetails page you can add this render condition to hide it, if your file is of PDF format.

Avatar

Administrator

@Anudeep_Kumar We hope you found the AEM community valuable. We anticipate your return as either a learner or a contributor. The community benefits from SMEs like you. Please ask your AEM peers to join and contribute. Happy AEM learning!



Kautuk Sahni

Avatar

Level 2

Hi @aanchal-sikka ,

Thanks for the solution, I have tried overlaying the same from /libs but I could not be able to hide it. Please find the screenshot for the reference, let me know if I have missed anything1render.png

Avatar

Community Advisor

Hi @Anudeep_Kumar, You can hide "Quick Publish" using User Permission. To resolve the same issue, we created two types of user group; for example, AEM Demo Author and AEM Demo Approver.

AEM Demo Author
/content/dam/[project-name] - Read (X), Modify(X), Create (X), Delete(X)

AEM Demo Approver
/content/dam/[project-name] - Read (X), Modify(X), Create (X), Delete(X), Replicate (X)