cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco Inherit Permissions Button

tiagomonteiro
Champ in-the-making
Champ in-the-making
Hello Alfresco community. Is there anyway to enable the Inherit Permissions Button? I need to set access rules by user and group but i don't know why the Inherit Permissions Button is not showing. Any suggestion?

Thanks
2 REPLIES 2

jpotts
World-Class Innovator
World-Class Innovator
Hi Tiago, and welcome. We're glad you are here.

Can you give us a little more info. What is your specific Alfresco version and what kind of folder are you managing the permissions on? Is it a folder in a Share document library or a non-document library folder in the repository view?

There should be nothing special you need to do to enable that button.

Jeff

smayuri
Champ in-the-making
Champ in-the-making

Hi,

I am trying to create a custom folder in Create menu of Document Library called 'Confidential Folder' in Alfresco. I've attempted the following procedure,

 

1. I have used the Alfresco Maven SDK to create a project that will package up my customizations in two AMPs (Alfresco Module Packages). One AMP is for the Alfresco web application (the "repo" tier) and the other is for the Alfresco Share web application (the "Share" tier).

2. I have added the following code in share-config-custom.xml,

<config evaluator="string-compare" condition="DocumentLibrary">
   <create-content>
     <content id="confidentialFolder" mimetype="text/plain"
     label="Confidential Folder" itemid="cm:folder" icon="finalize">
             <param name="action">confidential-folder</param>
     </content>
   </create-content>
</config>

 

3. In service-context.xml I registered the bean 

 

<bean id="confidential-folder" class="com.finalize.action.executer.ConfidentialFolder"
          parent="action-executer">
     <property name="nodeService">
          <ref bean="NodeService" />
     </property>
</bean>

 

4. And wrote the Java class for execute the action which will Off the Inheritance Permission,

package com.finalize.action.executer;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.alfresco.repo.action.ParameterDefinitionImpl;
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ParameterDefinition;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;

import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.repo.security.permissions;
import org.alfresco.repo.policy.ClassPolicy;

//import org.alfresco.repo.events.EventsService;


public class ConfidentialFolder extends ActionExecuterAbstractBase {
     public static final QName DISABLE = QName.createQName(NamespaceService.ALFRESCO_URI, "onInheritPermissionsDisabled");

     //     protected EventsService eventsService;
     protected NodeService nodeService;

     /* public void setEventsService(EventsService eventsService)
    {
        this.eventsService = eventsService;
    }*/

     public void setNodeService(NodeService nodeService)
     {
          this.nodeService = nodeService;
     }

     /*public void onInheritPermissionsDisabled(NodeRef nodeRef, boolean async)
     {
          inheritPermissionsDisabled(nodeRef, async);
     }*/

     @Override
     protected void executeImpl(Action action, NodeRef actionedUponNodeRef) {

          onInheritPermissionsDisabled(actionedUponNodeRef,false);

          //          private static final QName POLICY_ON_INHERIT_PERMISSIONS_DISABLED = QName.createQName(NamespaceService.ALFRESCO_URI, "onInheritPermissionsDisabled");
          //               nodeService.addAspect(actionedUponNodeRef, QName.createQName(FinalizeModel.NAMESPACE_FINALIZE_CONTENT_MODEL, FinalizeModel.ASPECT_FIN_WEBABLE), properties);

     }

     @Override
     protected void addParameterDefinitions(List<ParameterDefinition> paramList) {
          paramList.add(
                    new ParameterDefinitionImpl(               // Create a new parameter definition to add to the list
                              "active",                           // The name used to identify the parameter
                              DataTypeDefinition.BOOLEAN,             // The parameter value type
                              false,                                  // Indicates whether the parameter is mandatory
                              getParamDisplayLabel("active")));   // The parameters display label

     }

}

I wanted to Off or Disable  the Inheritance Permission from Confidential folder menu but I am not able to achieve or add the behaviour of "Confidential folder".

Can you please help me? 

Thanks in advance.