Expand my Community achievements bar.

SOLVED

Restricting authors not to add new components to parsys in design mode

Avatar

Level 4

Hi ,

Generally Authors edit the components. Suppose we have designed a page by activating the necessary components.

Later authors should have only the feature that they can edit the activated (already included )components on page. They should not be able to add new components to parsys in design mode. 

Could you please let me know, whether we can restrict like this. If so, Please let me know how.

 

Thanks in advance

Best Regards,

Vijaya

1 Accepted Solution

Avatar

Correct answer by
Level 10

You have to remove the access to 'Design' mode for the authors

To do the same, you can follow the below steps

1. Goto /useradmin

2. Goto the group ex: authors

3. Click on permissions and go to /etc/designs

4. Just give 'read' permission and remove all other

save and login as author and verify.

View solution in original post

2 Replies

Avatar

Administrator

Hi

Adding to what Ratna has mentioned, you can also limit the number of components added in a parsys:

Old Forum Thread link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage... 

//

//Limit the number of Components added in a Parsys

Touch UI:- http://experience-aem.blogspot.in/2016/01/aem-61-touch-ui-limit-the-number-of-components-added-in-pa... Demo | Package Install

Classic UI:- http://experience-aem.blogspot.in/2016/01/aem-61-classic-ui-limit-components-added-in-parsys.html Demo | Package Install

Set the Limit - Design Mode

 



Stored in CRX
 



Limit Exceeded Error on Component Drop or Insert - Edit Mode
 

 

Another Reference Article :- http://wcmaem.blogspot.in/2013/12/copy-parsys-component.html

//

Customization of parsys to restrict number of compnents in CQ

  1. Copy the parsys component from(/libs/foundation/components/parsys) to your poroject(/apps/<project nmae>/components/).
     2.  In the design dialog add number filed configuration to enter the number of components.
 
           Crate node noofcomp of type cq:widget under /apps/<project nmae>/components/parsys
              /design_dialog/items.
           Add the following properties
 
           xtype : numberfield
           name : noOfComp
           maxValue : 20
           fieldLabel : No of components
 
 
     3.   Create ajax.jsp and write the below logic.
           <%@page import="com.day.cq.wcm.foundation.ParagraphSystem"%>
           <%@include file="/libs/foundation/global.jsp"%>
           <%
                 ParagraphSystem parSys = ParagraphSystem.create(resource, slingRequest);
                 int totalComponents=parSys.paragraphs().size();
                 int restrictCompoNo=Integer.parseInt(currentStyle.get("noOfComp","20"));
 
                if(totalComponents >= restrictCompoNo){
                      out.println("true");
                  }else{
                            out.println("false");
                    }
               %>
 4.  You need to overlay the EditBase.js and Sidekick.js
 
          Create the following structure   /apps/cq/ui/widgets/source/widgets/wcm
 
         then copy the EditBase.js and Sidekick.js form libs . Place under /wcm /
   
         In Sidekic.js at line 4098 in set timeout method add this snippet.
 
            var parentPath=editComponent.path;
            var ajaxUrl=parentPath.substr(0,parentPath.lastIndexOf("/"))+".ajax";
            var notAllowToCreate = CQ.HTTP.eval(ajaxUrl);
           
            if(!notAllowToCreate){
                editComponent.createParagraph(definition);
 
            }else{
                CQ.Ext.Msg.show({
                                   msg: 'You reached  the maximun limit. You can set the limit in disign mode.',
                                   buttons: CQ.Ext.Msg.OK,
                                   icon: CQ.Ext.MessageBox.WARNING
                                });
 
               }
                dropTarget.editComponent.hideTarget();
 
 
         In EditBase.js at line 1181  in set timeout method add this snippet.
       
           var parentPath=e.path;
            var ajaxUrl=parentPath.substr(0,parentPath.lastIndexOf("/"))+".ajax";
            var notAllowToCreate = CQ.HTTP.eval(ajaxUrl);    
            if(!notAllowToCreate){
                e.createParagraph(definition);
 
            }else{
                CQ.Ext.Msg.show({
                    msg: 'You reached  the maximun limit. You can set the limit in disign mode.',
                    buttons: CQ.Ext.Msg.OK,
                    icon: CQ.Ext.MessageBox.WARNING
                });
               
            }
            e.dialogs[CQ.wcm.EditBase.INSERT].hide();
            e.insertDialogMask.hide();

 

Old Forum Thread 2:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

//

Coming to original question Allowed component is part of design. Make sure to configure the property "components" as type string[] with list of all the components.As an example for geometrixx you can refer /etc/designs/geometrixx/jcr:content/contentpage/par/@components.   Another trick you can follow is http://experiencedelivers.adobe.com/cemblog/en/experiencedelivers/2012/06/default-components-in-your...

[1]  http://labs.sixdimensions.com/blog/2013-02-04/flexible-cq5-pages/

 

Old Forum Thread 3:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

Reference Article:- http://stackoverflow.com/questions/23275062/restrict-the-components-in-aem-5-6-1

 

I hope this would help you.


Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Correct answer by
Level 10

You have to remove the access to 'Design' mode for the authors

To do the same, you can follow the below steps

1. Goto /useradmin

2. Goto the group ex: authors

3. Click on permissions and go to /etc/designs

4. Just give 'read' permission and remove all other

save and login as author and verify.