Ich versuche, einen Weg zu finden, um die vollständige Benutzerliste für ein Lotus Notes-Dokument zu erhalten. Ich kann die Benutzer nicht abrufen und ihre Berechtigungen in openCMIS anzeigen.wie AclServiceUtils.getAcl() zu implementieren, um Benutzerinformationen aus Lotus Notes abrufen
Kann jemand die komplette ACL jedes Benutzers für ein bestimmtes Dokument erhalten?
public class AclServiceUtils {
private static final Logger LOGGER = LoggerFactory.getLogger(AclServiceUtils.class);
public static Acl getAcl(Session session, String objectId, Boolean onlyBasicPermissions) throws IOException {
ObjectIdentity objId = ObjectIdentity.getObjectIdentity(objectId);
try {
AccessControlListImpl acl = new AccessControlListImpl();
List<Ace> aces = new ArrayList<Ace>();
PrincipalImpl principal=new PrincipalImpl();
principal.setId(objId.getType() + " ");
// here we want info of user
AccessControlEntryImpl ace = new AccessControlEntryImpl();
ace.setDirect(true);
ace.setPrincipal(principal);
aces.add(ace);
acl.setAces(aces);
return acl;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
public class ObjectIdentity {
@JsonIgnore
private static final ObjectMapper mapper = new ObjectMapper();
@JsonIgnore
private static final String UTF_8 = "UTF-8";
private ObjectIdentityType type;
private String unid;
private String id;
private String parentFolderPath;
public ObjectIdentityType getType() {
return type;
}
public void setType(ObjectIdentityType type) {
this.type = type;
}
public String getUnid() {
return unid;
}
public void setUnid(String unid) {
this.unid = unid;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getParentFolderPath() {
return parentFolderPath;
}
public void setParentFolderPath(String parentId) {
this.parentFolderPath = parentId;
}
@JsonIgnore
public String getEncodedObjectId() throws IOException {
String json = mapper.writeValueAsString(this);
byte[] encodeBase64 = Base64.encode(json);
String result = new String(encodeBase64);
result = URLEncoder.encode(result, UTF_8);
return result;
}
@JsonIgnore
public static ObjectIdentity getObjectIdentity(String encodedString)
throws IOException {
String decodedString = URLDecoder.decode(encodedString, UTF_8);
byte[] decodeBase64 = Base64.decode(decodedString);
String result = new String(decodeBase64);
return mapper.readValue(result, ObjectIdentity.class);
}
public static void main(String args[]) throws IOException{
ObjectIdentity identity = new ObjectIdentity();
identity.setId("<[email protected]>");
identity.setUnid("DEF");
identity.setType(ObjectIdentityType.ATTACHMENT);
ObjectIdentity decoded = ObjectIdentity.getObjectIdentity(identity.getEncodedObjectId());
/*System.out.println(decoded.id);
System.out.println(decoded.unid);
System.out.println(decoded.type);*/
System.out.println(decoded.id.equals(identity.id));
}
}
Welche Art von Benutzerinformationen möchten Sie von IBM Notes Domino abrufen? –
Zu Zugriffsberechtigungen –
Ein Notes-Dokument kann Leser- und Autorenfelder enthalten. Sie können Benutzernamen, Gruppennamen und Rollen enthalten. Die ACL der Datenbank listet alle Benutzer und Benutzergruppen mit ihren spezifischen Rechten und Rollen auf. Also, was brauchst du genau? Alle Benutzer, die ein bestimmtes Dokument lesen oder aktualisieren können? –