Using the repository extension from the files UserInfoCustomResponse.java
and fme-user-info-context.xml
you can add custom doclib metadata as a json object. This data will be pulled into the browser with Share's DocLib XHR request and can be used to configure or extend the document library.
To use the custom data in a Share document library action evaluator you can write an evaluator in as shown in the file FmeGroupEvaluator.java
This can be registered as usual...
<bean id="evaluator.doclib.fme.group" class="de.fme.share.evaluator.FmeGroupEvaluator" />
and used in the action definitions as such, e.g. to restrict the users who can use the copy-to action:
<!-- Copy to -->
<action id="document-copy-to" type="javascript" label="actions.document.copy-to">
<param name="function">onActionCopyTo</param>
<evaluator negate="true">evaluator.doclib.action.transferred</evaluator>
<evaluator negate="true">evaluator.doclib.action.isLocked</evaluator>
<evaluator negate="true">evaluator.doclib.indicator.IsReadOnly</evaluator>
<evaluator>evaluator.doclib.fme.group</evaluator>
</action>
This adds a custom JSON property to the Document Library that can be used in your Javascript extensions, e.g. in the toolbar Share javascript:
doclistToolbar.modules.docList.doclistMetadata.custom.fme.authorities
--> ["GROUP_ALFRESCO_ADMINISTRATORS", "GROUP_EVERYONE", "GROUP_site_swsdp",
"GROUP_site_swsdp_SiteManager", "ROLE_ADMINISTRATOR"]