document.setInheritsPermissions(false);
document.save();
var permissions = document.permissions;
var acl=[];
for (var j=0; j < permissions.length; j++)
{
acl = permissions[j].split(";");
var perm=acl[2];
var grp=acl[1];
document.removePermission(perm,grp);
document.save();
}
document.setPermission("Coordinator", "user1");
document.save();
document.setPermission("Coordinator", "user2");
document.save();
var mail = actions.create("mail");
mail.parameters.to="jherraiz986g@cv.gva.es";
mail.parameters.subject = "Permisos";
mail.parameters.from = "noreply@notasinternas.edu.gva.es";
mail.parameters.text = permissions+"hola hola hola permisos añadidos –> "+document.permissions;
var doc=companyhome.childByNamePath("Data Dictionary/Email Templates/notify_user_email.ftl");
mail.execute(doc);
<event type="node-enter">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
for (var i = 0; i < bpm_package.children.length; i++)
{
bpm_package.children[i].setInheritsPermissions(false);
var permissions = bpm_package.children[i].permissions;
var acl=[];
for (var j=0; j < permissions.length; j++)
{
acl = permissions[j].split(";");
var perm=acl[2];
var grp=acl[1];
bpm_package.children[i].removePermission(perm,grp);
}
bpm_package.children[i].setPermission("Consumer", reviewer.properties["cm:userName"]);
}
var mail = actions.create("mail");
mail.parameters.to = "correo@correo.es";
mail.parameters.subject = "Notificacion de tarea asignada";
mail.parameters.from = "noreply@notasinternas.edu.gva.es";
mail.parameters.text = reviewer.properties["cm:userName"]+"No responda a este mensaje.Tiene una tarea ASIGNADA debe revisarla aqui http://notasinternas.edu.gva.es";
mail.execute(bpm_package);
</script>
</action>
</event>
for (var j=0; j < permissions.length; j++)
{
acl = permissions[j].split(";");
var perm=acl[2];
var grp=acl[1];
bpm_package.children[i].removePermission(perm,grp);
}
con este for los permisos del documento se estan recorriendo y se le estan quitando. ¿que ocurria entonces?bpm_package.children[i].setPermission("Editor", bpm_assignee.properties["cm:userName"]);
bpm_package.children[i].save();
bpm_package.children[z].removePermission("Coordinator", reviewer.properties["cm:userName"]);Ya no falla, por lo que deduzco que donde da acces denied, es en esta instrucción,
bpm_package.children[z].save();
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.