Bonjour,J'ai essayé de programmer les permissions voulues sur chaque répertoire selon les utilisateurs (administrateur, …). Mais un problème est apparu au niveau de cette instruction "accessControlService.addACEs(predicate, new ACE[] { new ACE("GROUP_AWSBOOK", Constants.READ, AccessStatus.acepted) });" . Comment résoudre ce problème?Mon code source est
try {
ParentReference parent = new ParentReference(storeRef,null,"/app:company_home",Constants.ASSOC_CONTAINS,"{" + Constants.NAMESPACE_CONTENT_MODEL + "}"+name);
System.out.println("node reference");
//create the node reference
Reference reference = new Reference();
reference.setStore(storeRef);
reference.setPath("/app:company_home/cm:"+ISO9075.encode(name));
//set mime type and encoding for indexing
ContentFormat format = new ContentFormat(mimeType, encoding);
System.out.println("predicate");
//create the predicate
Predicate predicate = new Predicate();
predicate.setNodes(new Reference[]{reference});
AccessControlServiceSoapBindingStub accessControlService = WebServiceFactory.getAccessControlService();
System.out.println("fin predicate");
System.out.println("debut ace");
//add ACE
ACE ace = new ACE();
ace.setAuthority("faten");
ace.setPermission(Constants.READ);
ace.setAccessStatus(AccessStatus.acepted);
System.out.println("fin ace");
System.out.println("debut acl");
//ACL[] acl = accessControlService.addACEs(predicate, new ACE[]{ace});
/*for (ACL aclElement : acl) {
ACE[] aces = aclElement.getAces();
for (ACE aceElement : aces) {
System.out.println("addACEs | Authority: "+aceElement.getAuthority() +" | Permission: " +aceElement.getPermission());
}
}*/
//——————————————————————————
//accessControlService.addACEs(predicate, new ACE[] { new ACE("GROUP_AWSBOOK", Constants.READ, AccessStatus.acepted) });
try {
accessControlService.addACEs(predicate, new ACE[] { new ACE("GROUP_AWSBOOK", Constants.READ, AccessStatus.acepted) });
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.out.println("erreur");
}
//——————————————————————————
System.out.println("fin acl");
System.out.println("debut permission");
//getPermissions
/*GetPermissionsResult[] permissionsList = accessControlService.getPermissions(predicate);
GetPermissionsResult permissions = permissionsList[0];
String[] permissionsCurrent = permissions.getPermissions();
for (String permission : permissionsCurrent) {
System.out.println("Permission: "+permission);
System.out.println("fin permission");
}*/
} finally {
//AuthenticationUtils.endSession();
}
//System.out.println("permission success");