Evaluator for group membership
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2014 01:57 PM
Why this evaluator dowsn't work:
I need it in doclib action evaluation
<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'> <beans> <!– Has "isoDocument:isoDocumentPublished" evaluator –> <bean id="com.pasello.iso.isoDocumentAspect" parent="evaluator.doclib.action.hasAspect"> <property name="aspects"> <list> <value>isoDocument:isoDocumentPublished</value> </list> </property> </bean> <bean id="com.pasello.iso.isoDocumentManagers" parent="evaluator.doclib.action.groupMembership"> <property name="relation" value="OR"/> <property name="groups"> <list> <value>isoDocumentManagers</value> </list> </property> </bean></beans>
I need it in doclib action evaluation
<alfresco-config> <config evaluator="string-compare" condition="DocLibActions"> <!– Action definitions –> <actions> <!– Transfor Document To PDF –> <action id="publish-to-ISO" type="javascript" label="Pubblica su documentazione ISO"> <param name="function">onActionSimpleRepoAction</param> <!– Additional parameters for onRepoAction function –> <param name="action">publish-to-ISO</param> <param name="successMessage">Pubblicata corrattamente sulla documentazione ISO</param> <param name="failureMessage">Errore di pubblicazione contattare l'amministratore del sistema</param> <evaluator negate="true">com.pasello.iso.isoDocumentAspect</evaluator> <evaluator>com.pasello.iso.isoDocumentManagers</evaluator> </action> </actions> <actionGroups> <actionGroup id="document-browse"> <action index="460" id="publish-to-ISO"/> </actionGroup> <actionGroup id="document-details"> <action index="400" id="publish-to-ISO"/> </actionGroup> </actionGroups> </config></alfresco-config>
Labels:
- Labels:
-
Archive
7 REPLIES 7
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2014 01:59 AM
I make mistake with double evaluator. Sorry, but the evaluator evaluator.doclib.action.groupMembership, doesn't work. this is the correct code
<alfresco-config> <config evaluator="string-compare" condition="DocLibActions"> <!– Action definitions –> <actions> <!– Transfor Document To PDF –> <action id="publish-to-ISO" type="javascript" label="Pubblica su documentazione ISO"> <param name="function">onActionSimpleRepoAction</param> <!– Additional parameters for onRepoAction function –> <param name="action">publish-to-ISO</param> <param name="successMessage">Pubblicata corrattamente sulla documentazione ISO</param> <param name="failureMessage">Errore di pubblicazione contattare l'amministratore del sistema</param> <evaluator>com.pasello.iso.isoDocument</evaluator> </action> </actions> <actionGroups> <actionGroup id="document-browse"> <action index="460" id="publish-to-ISO"/> </actionGroup> <actionGroup id="document-details"> <action index="400" id="publish-to-ISO"/> </actionGroup> </actionGroups> </config></alfresco-config>
<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'> <beans> <!– Has "isoDocument:isoDocumentPublished" evaluator –> <bean id="com.pasello.iso.isoDocumentAspect" parent="evaluator.doclib.action.hasAspect"> <property name="aspects"> <list> <value>isoDocument:isoDocumentPublished</value> </list> </property> <property name="negateOutput" value="true" /> </bean> <bean id="com.pasello.iso.isoDocumentManagers" parent="evaluator.doclib.action.groupMembership"> <property name="relation" value="OR"/> <property name="groups"> <list> <value>isoDocumentManagers</value> </list> </property> </bean> <bean id="com.pasello.iso.isoDocument" parent="evaluator.doclib.action.chainedMatchOne"> <property name="evaluators"> <list> <ref bean="com.pasello.iso.isoDocumentManagers" /> <ref bean="com.pasello.iso.isoDocumentAspect" /> </list> </property> </bean></beans>
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2014 03:08 AM
Hi,
When you say, it does not working, means, does the bean is getting when you debug the evaluator code?
Please let me know, where you have defined the "evaluator.doclib.action.groupMembership" bean?
When you say, it does not working, means, does the bean is getting when you debug the evaluator code?
Please let me know, where you have defined the "evaluator.doclib.action.groupMembership" bean?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2014 03:29 AM
It is definied as default in 4.2f. It is defined in: slingshot-documentlibrary-context.xml
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2014 10:44 AM
<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'> <beans> <!– Has "isoDocument:isoDocumentPublished" evaluator <bean id="com.pasello.iso.isoDocumentAspect" parent="evaluator.doclib.action.hasAspect"> <property name="aspects"> <list> <value>isoDocument:isoDocumentPublished</value> </list> </property> </bean>–> <bean id="evaluator.doclib.action.groupMembership" class="org.alfresco.web.evaluator.HasGroupMembershipsEvaluator"> <property name="slingshotEvaluatorUtil" ref="slingshot.evaluator.utility" /> </bean> <bean id="com.pasello.iso.isoDocument" parent="evaluator.doclib.action.groupMembership"> <property name="groups"> <list> <value>GROUP_isoDocumentManagers</value> </list> </property> </bean><!– <bean id="com.pasello.iso.isoDocumentManagers" parent="evaluator.doclib.action.groupMembership"> <property name="groups"> <list> <value>GROUP_isoDocumentManagers</value> </list> </property> </bean> <bean id="com.pasello.iso.isoDocument" parent="evaluator.doclib.action.chainedMatchAll"> <property name="evaluators"> <list> <ref bean="com.pasello.iso.isoDocumentManagers" /> <ref bean="com.pasello.iso.isoDocumentAspect" /> </list> </property> </bean> –></beans>
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2014 01:08 PM
I set up a simple test for the GroupMembership evaluator.
Here is my share-config-custom.xml related to the evaluator:
And here is the snippet from my context XML:
When I log in as a member of the Publisher group, I see the link to ecmarchitect but I do not see the link to metaversant, which is working as I expect.
When I log in as someone who is not a member of the Publisher group, I do not see either action, which is not what I expect based on that negate. But you aren't using negate so that isn't relevant to you.
Jeff
Here is my share-config-custom.xml related to the evaluator:
<config evaluator="string-compare" condition="DocLibActions"> <actions> <action id="someco-web-site" type="link" label="actions.someco.web-site" icon="someco-website"> <param name="href">http://ecmarchitect.com</param> <param name="target">_blank</param> <evaluator>someco.evaluator.doclib.action.isPublisher</evaluator> </action> <action id="metaversant-web-site" type="link" label="actions.someco.web-site" icon="someco-website"> <param name="href">http://www.metaversant.com</param> <param name="target">_blank</param> <evaluator negate="true">someco.evaluator.doclib.action.isPublisher</evaluator> </action>
And here is the snippet from my context XML:
<bean id="someco.evaluator.doclib.action.isPublisher" parent="evaluator.doclib.action.groupMembership"> <property name="groups"> <list> <value>GROUP_publisher</value> </list> </property> </bean>
When I log in as a member of the Publisher group, I see the link to ecmarchitect but I do not see the link to metaversant, which is working as I expect.
When I log in as someone who is not a member of the Publisher group, I do not see either action, which is not what I expect based on that negate. But you aren't using negate so that isn't relevant to you.
Jeff
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2015 02:46 AM
dear jeff,
I have similar problem with group membership evaluator.
here's my share-config-custom.xml snippet
and here's my context.xml snippet
it only work on admin user only and the member of group DOCUMENT_CONTROLLER doesn't have acces to the actions…
I have similar problem with group membership evaluator.
here's my share-config-custom.xml snippet
<action id="document-manage-aspects" type="javascript" label="actions.document.manage-aspects"> <param name="function">onActionManageAspects</param> <permissions> <permission allow="true">Write</permission> </permissions> <evaluator negate="true">evaluator.doclib.action.isLocked</evaluator> <evaluator>my.evaluator.doclib.action.isManager</evaluator> </action>
and here's my context.xml snippet
<bean id="my.evaluator.doclib.action.isManager" parent="evaluator.doclib.action.groupMembership"> <property name="relation" value="OR" /> <property name="groups"> <list> <value>GROUP_ALFRESCO_ADMINISTRATORS</value> <value>GROUP_DOCUMENT_CONTROLLER</value> </list> </property> </bean>
it only work on admin user only and the member of group DOCUMENT_CONTROLLER doesn't have acces to the actions…
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2019 12:26 PM
You need to prepend the group name with "GROUP_", so it will be something like
<bean id="com.pasello.iso.isoDocumentManagers" parent="evaluator.doclib.action.groupMembership">
<property name="relation" value="OR"/>
<property name="groups">
<list>
<value>GROUP_isoDocumentManagers</value>
</list>
</property>
</bean>
