use of lotus.notes.addins.DominoServer in project openliberty-domino by OpenNTF.
the class IdentityServlet method getUniqueGroupIds.
@SuppressWarnings("unchecked")
private String getUniqueGroupIds(String uniqueUserId) throws NotesException {
Session session = NotesFactory.createSession();
try {
DominoServer server = new DominoServer(session.getUserName());
String name = getUserSecurityName(uniqueUserId);
List<String> names = new ArrayList<>((Collection<String>) server.getNamesList(name));
// $NON-NLS-1$
int starIndex = names.indexOf("*");
if (starIndex > -1) {
// Everything at and after this point should be a group or
// pseudo-group (e.g. "*/O=SomeOrg")
names = names.subList(starIndex, names.size());
}
// $NON-NLS-1$
return String.join("\n", names);
} finally {
session.recycle();
}
}
use of lotus.notes.addins.DominoServer in project org.openntf.domino by OpenNTF.
the class LogReader method canReadLogs.
/**
* Whether or not the effective user of the Session has access to read logs
*
* @param session
* Session (remember you can use sessionAsSigner / sessionAsSignerWithFullAccess)
* @return boolean whether user has access
* @since org.openntf.domino.xsp 2.5.0
*/
private boolean canReadLogs(final lotus.domino.Session session) {
boolean result = false;
try {
String username = session.getEffectiveUserName();
DominoServer server = new DominoServer();
result = server.checkServerAccess(username, ServerAccess.PROG_UNRESTRICTED);
result = result || server.checkServerAccess(username, ServerAccess.VIEW_ONLY_ADMIN);
} catch (NotesException ne) {
ne.printStackTrace();
}
return result;
}
use of lotus.notes.addins.DominoServer in project org.openntf.domino by OpenNTF.
the class ServerProvider method processRequest.
@Override
public Object processRequest(FramedGraph graph, String item, MultivaluedMap<String, String> params) {
Map<String, String> result = new LinkedHashMap<String, String>();
try {
Session session = Factory.getSession(SessionType.NATIVE);
String serverName = session.getEffectiveUserName();
DominoServer server = new DominoServer(serverName);
result.put("servername", serverName);
result.put("platform", server.getPlatform());
} catch (Throwable t) {
t.printStackTrace();
}
return result;
}
use of lotus.notes.addins.DominoServer in project org.openntf.domino by OpenNTF.
the class Name method getGroups.
@Override
@SuppressWarnings("unchecked")
public Collection<String> getGroups(final String serverName) {
if (groupNames_ == null) {
try {
DominoServer server = new DominoServer(serverName);
groupNames_ = server.getNamesList(getCanonical());
} catch (NotesException e) {
DominoUtils.handleException(e);
}
}
return groupNames_;
}
use of lotus.notes.addins.DominoServer in project org.openntf.domino by OpenNTF.
the class NameODA method getGroups.
@SuppressWarnings("unchecked")
@Override
public Collection<String> getGroups(final String serverName) {
Collection<String> result = null;
try {
DominoServer server = new DominoServer(serverName);
result = server.getNamesList(getCanonical());
} catch (NotesException e) {
DominoUtils.handleException(e);
}
return result;
}
Aggregations