cancel
Showing results for 
Search instead for 
Did you mean: 

Changes allowed on some metadata only

silgar
Champ in-the-making
Champ in-the-making
We need, under certain conditions, to prevent changes to some metadata, while allowing modifications to the other metadata.
We are using Alfresco Share 3.4.d Community.
We have a custom content (documentci) specializing cm:content.
We added aspects and properties to documentci.
We want to restrict modifications to a subset of metadata depending on the value of a property (the state of the document).
How could we implement this?
2 REPLIES 2

mrogers
Star Contributor
Star Contributor
You can use forms to make certain fields display read only.   

Its not really property level permissions but it is better than nothing.

silgar
Champ in-the-making
Champ in-the-making
Thanks!
Following your suggestion we have to implement theese steps:

1) create in share-config-custom.xml a new form for "custom:documentci" type,
     with modifiable and read-only fields as we need (ok, we know how to do it)

2) add a new custom action "Edit Metadata" in the right-side list of actions in the document details view (ok).
    The new action will be displayed depending on the value of document property "custom:state".  
    We can define new 'evaluators' in the file:
    \alfresco\WEB-INF\classes\alfresco\templates\webscripts\org\alfresco\slingshot\documentlibrary\evaluator.lib.js

       if ( node.properties["custom:state"]=="Approved" )  {
               permissions["edit-approved"] = true;
       } else  {
               permissions["edit-notapproved"] = true;
       }

    and modify the file
    \share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\document-details\repo-document-actions.get.config.xml

    adding the new "Edit Metadata" action that will open the new form, and changing the permission of out-of-the-box  "Edit Metadata" action:

    <actionSet id="document">
        …..
       <action type="simple-link" id="onActionDetails" permission="edit-properties,edit-notapproved" href="{editMetadataUrl}"
                   label="actions.document.edit-metadata" />
       <action type="simple-link" id="onActionDetails" permission="edit-properties,edit-approved" href="????????"
                   label="actions.document.edit-metadata" />   
    </actionSet>


>>> We don't know how to call the new form when the user clicks the new custom "Edit Matadata" action.

Could you please help us with this point?