cancel
Showing results for 
Search instead for 
Did you mean: 

permissions to document in workflows

giorgio
Champ in-the-making
Champ in-the-making
Hi , I've been able to discover the problem when I only had permissions assigned to a user in parallel flow, it was that I was breaking the other, but now I find another question, which is that I am assigning the permissions the document with the following line to create the workflow "bpm_package.children . setPermission (" Coordinator ", reviewer.properties [" cm: userName "]);
"But I like the flow when finished, remove those permissions I added previously, so I run the following line" bpm_package.children . removePermission ( "Coordinator", reviewer.properties [ "cm: userName "]);" but
I get an access denied error, you know for what reason can this happen?

Greetings.
1 REPLY 1

jenn_l
Champ on-the-rise
Champ on-the-rise
Hoi ,

Why don't you try the following script in transition name = "reject" to ="endreview":
<script>
                     for (var i = 0; i &lt; bpm_package.children.length; i++)
                    {
                        var username = reviewer.properties["cm:userName"];
                  
                  if (logger.isLoggingEnabled()) logger.log("Removing permission Coordinator for " + username);
                  var document = bpm_package.children[i];
                  var parent = bpm_package.children[i].getParent();
                  /* Hide it. */
                  document.removePermission("Coordinator",username);
                  /* Disable check-out/check -in. */
                  parent.removePermission("Coordinator",username);
                    }
                </script>
Also with the transition name="approve" to ="endreview">

Regards,