syntax of Condition in Action filter
i would like to disable document creation according to a user attribute. The best way would be to overload the create and import action filters, but i'm not sure it's possible, so, I just overloaded the newDocument action with a custom filter that checks against a user attribute but it seems i'm missing the right syntax. I'm runnig a 5.4.2 server.
<action icon="/icons/action_add.gif" id="newDocument" label="action.new.document" link="javascript:Richfaces.showModalPanel('selectDocTypePanel');">
<category>SUBVIEW_UPPER_LIST_HREF</category>
<filter-id>create</filter-id>
<filter-id>over_quota</filter-id>
<filter id="over_quota">
<rule grant="false">
<condition>#{userSession.currentUser.quota>99}</condition>
</rule>
</filter>
</action>
Is this working?
<condition>${currentUser.model.user.quota>20}</condition>
currentUser is an instance of NuxeoPrincipal. You need to get to its corresponding document model to retrieve properties on it
<filter append="true" id="create">
<rule grant="false">
<condition>${currentUser.model.user.quota>10}</condition>
</rule>
</filter>
<action icon="/icons/action_add.gif" id="newDocument" label="action.new.document" link="javascript:Richfaces.showModalPanel('selectDocTypePanel');">
<category>SUBVIEW_UPPER_LIST_HREF</category>
<filter-id>create</filter-id>
<filter-id>over_quota</filter-id>
<filter id="over_quota">
<rule grant="false">
<condition>${currentUser.model.user.quota>10}</condition>
</rule>
</filter>
</action>
Use ${currentUser.schemaName.fieldName}
i ve overidden the user schema :
<extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
<schema name="user" src="userShib.xsd" override="true" />
</extension>
so, following your advice, i tried
<condition>${currentUser.user.quota>20}</condition>
that does not seem to work.