AnsweredAssumed Answered

How to extend (customize) public-services-security-context.x

Question asked by tomasp on Oct 13, 2011
Latest reply on Oct 4, 2013 by douglascrp
Hi,

I implemented my own DynamicAuthority and put classes to the AMP file (inspired by https://forums.alfresco.com/en/viewtopic.php?t=17436#p60903). Now I need to customize public-services-security-context.xml:
1. adding bean definition of my new Authority class. I can put this definition to the new *-context.xml (for ex. extended-security-context.xml) and then put this file to the AMP. I think it's OK.
2. insert this bean to the list of used dynamic authorities:


<bean id="permissionServiceImpl" class="org.alfresco.repo.security.permissions.impl.PermissionServiceImpl">

    <property name="nodeService">
        <ref bean="mtAwareNodeService" />
    </property>
    …
    <property name="dynamicAuthorities">
        <list>
            <ref bean="ownerDynamicAuthority" />
            <ref bean="lockOwnerDynamicAuthority" />
            <!– my new dynamic authorities –>
            <ref bean="myDynamicAuthority" />
        </list>
    </property>

</bean>

So it seems I need to edit original public-services-security-context.xml and add appropriate line. But is it a preferred way? Can I put modified file to the AMP for easy installation? Or is there better way to add my bean to the dynamicAuthorities list?

I would like to have solution as compact as possible (due to easy future installation and support). Ideally, all together in the AMP.

Thanks for any suggestion

Tom

Outcomes