cancel
Showing results for 
Search instead for 
Did you mean: 

Change actions available on document depend on metadata

dabada83
Champ in-the-making
Champ in-the-making
I need to change the actions availables on documents depends on metadata.  I found a function on document-actions.js but my changes seems that no have effect.

original function

for (i = 0, ii = actions.length; i < ii; i++)
            {
               action = actions[i];
               actionAllowed = true;
               if (action.firstChild.rel !== "")
               {
                 actionPermissions = action.firstChild.rel.split(",");
                  for (j = 0, jj = actionPermissions.length; j < jj; j++)
                  {
             if (!userAccess[actionPermissions[j]])
           {
               actionAllowed = false;
               break;
           }
                  }
            }

mi change

for (i = 0, ii = actions.length; i < ii; i++)
            {
               action = actions[i];
               actionAllowed = true;
               if (action.firstChild.rel !== "")
               {
                  actionPermissions = action.firstChild.rel.split(",");
                  for (j = 0, jj = actionPermissions.length; j < jj; j++)
                  {
                        actionAllowed = false;
                        break;
                  }
               }

best regards
4 REPLIES 4

sselvan
Champ in-the-making
Champ in-the-making
Your changes are not enough to get to your change, I believe.
You might want to know more about Alfresco Architecture and read about WebScripts etc., if you didn't know already. (sorry, if not)

If you can post about your requirements more in detail - it will be easier to address, I guess!

dabada83
Champ in-the-making
Champ in-the-making
To solve this problem I change document-actions-min.js

dabada83
Champ in-the-making
Champ in-the-making
hello folks,

I need how to access to my custom metadata properties on a document, I created custom content type for books.
On document-actions-min.js I have this.assetData but this variable only have standar metadata

     this.assetData.title,
     this.assetData.description,
      this.assetData.createdBy,
      etc,

but I need access to my own property "allowDownload".

I tried to change doclist.get.js like this -> http://aniruddhchitre.wordpress.com/2009/07/03/custom-metdata-in-alfresco-share/ but seems not work

How I can do this???

best regards

dabada83
Champ in-the-making
Champ in-the-making
I solve this, I change doclis.get.js and doclist.get.json.ftl like this -> http://forums.alfresco.com/en/viewtopic.php?f=48&t=22737&p=74600&hilit=actions+conditions#p74600