03-15-2010 12:12 PM
<permissionGroup name="MonGroupe" allowFullControl="false" expose="true" >
<includePermissionGroup permissionGroup="Read" type="sys:base" />
<includePermissionGroup type="sys:base" permissionGroup="Write"/>
<includePermissionGroup type="cm:lockable" permissionGroup="CheckOut"/>
<includePermissionGroup permissionGroup="AddChildren" type="sys:base"/>
<includePermissionGroup permissionGroup="ReadPermissions" type="sys:base" />
<includePermissionGroup permissionGroup="ChangePermissions" type="sys:base" />
</permissionGroup>
document.setPermission("Consumer", "EVERYONE");
document.setPermission("Collaborator", "EDF MOA");
document.setPermission("Delete","EDF MOA);
03-15-2010 01:29 PM
//Nombre de ligne
var files = new Array(18);
//Nombre de colonne
for(var i=0;i<files.length;i++)
{
files[i]=new Array(varFiles.length + 2);
}
//Liste des droits (groupe utilisateur//type utilisateur//classification du document//statut du document)
//On peut ajouter autant de ligne que possible, attention au nombre de ligne déclarée dans la variable "files"
files[0] = ["EDF MOA","Collaborator","SFG","Travail"];
files[1] = ["EDF MOA","Consumer","SFG","En relecture"];
files[2] = ["EDF MOA","Collaborator","SFG","Relu"];
files[3] = ["EVERYONE","Consumer","SFG","En validation"];
files[4] = ["EDF MOA","Collaborator","SFG","Validé"];
files[5] = ["EVERYONE","Consumer","SFG","Validé"];
files[6] = ["TMA","Collaborator","SFD","Travail"];
files[7] = ["TMA","Consumer","SFD","En relecture"];
files[8] = ["TMA","Collaborator","SFD","Relu"];
files[9] = ["EVERYONE","Consumer","SFD","En validation"];
files[10] = ["TMA","Collaborator","SFD","Validé"];
files[11] = ["EVERYONE","Consumer","SFD","Validé"];
files[12] = ["TMA","Collaborator","ETUTECH","Travail"];
files[13] = ["TMA","Consumer","ETUTECH","En relecture"];
files[14] = ["TMA","Collaborator","ETUTECH","Relu"];
files[15] = ["EVERYONE","Consumer","ETUTECH","En validation"];
files[16] = ["TMA","Collaborator","ETUTECH","Validé"];
files[17] = ["EVERYONE","Consumer","ETUTECH","Validé"];
//Pour les fichiers
var propertiesFiles = new Array(varFiles.length);
for(var i=0;i<varFiles.length;i++)
{
propertiesFiles[i] = document.properties[varFiles[i]];
}
//Vérification si le document herite des permissions "Parent" si oui alors on lui enleve
if (document.inheritsPermissions()==true)
{
document.setInheritsPermissions(false);
}
//Boucle pour parcourir toutes les déclarations
for(var i=0;i<files.length;i++)
{
var condition = true;
for(var j=0;j<varFiles.length;j++)
{
if (propertiesFiles[j] != files[i][j+2])
{
condition = false;
}
}
if (condition != false)
{
document.setPermission(files[i][1],files[i][0]);
}
if ((files[i][3] == "Travail") && (document.hasPermission("Delete") == false))
{
document.setPermission("Delete",files[i][0]);
}
if ((files[i][3] != "Travail") && (document.hasPermission("Delete") == true))
{
document.removePermission("Delete",files[i][0]);
}
}
03-18-2010 12:53 PM
03-20-2010 03:17 AM
Personne ne sait pourquoi un non admin ne peut pas lancer un script qui touche aux permissions ou aux propriétés d'un document ??
03-22-2010 05:42 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.