public class CheckUserPrivileges extends XMLRequest implements java.lang.Iterable<CheckUserPrivileges.Candidate>
CheckUserPrivileges.Candidate needs to be created.
The iterator of this class can be used to get the results of the check the request has been sent to the Automation Engine.
Example:
CheckUserPrivileges.Candidate user1 = new CheckUserPrivileges.Candidate(new UC4UserName("ANG/DEV"), Privilege.ACCESS_NOFOLDER);
CheckUserPrivileges.Candidate user2 = new CheckUserPrivileges.Candidate(new UC4UserName("ANG/DEV"), Privilege.ILM_ACTIONS);
CheckUserPrivileges check = new CheckUserPrivileges(user1, user2);
uc4.sendRequestAndWait(check);
for (CheckUserPrivileges.Candidate c : check) {
if (c.getResult()) {
System.out.println("User "+c.getUser()+" holds the privilege "+c.getPrivilege());
} else {
System.out.println("User "+c.getUser()+" does not hold the privilege "+c.getPrivilege());
}
}
| Modifier and Type | Class and Description |
|---|---|
static class |
CheckUserPrivileges.Candidate
Stores the name of the user, a privilege to check and the result of the check after the request has been sent.
|
| Constructor and Description |
|---|
CheckUserPrivileges(CheckUserPrivileges.Candidate... candidates)
Creates a new
CheckUserPrivileges request. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
createRequest(com.uc4.util.XMLDocument doc,
org.w3c.dom.Element request,
ConnectionAttributes sessionInfo)
Creates the XML Document for the request.
|
protected java.lang.String |
getSrc()
Returns the request source.
|
protected void |
handleContent(com.uc4.util.XMLDocument doc,
ConnectionAttributes session) |
protected boolean |
isAllowedInClientZero()
This method is used internally.
|
java.util.Iterator<CheckUserPrivileges.Candidate> |
iterator() |
int |
size()
Returns the number of candidates.
|
assertClientZero, assertServerVersion, checkClient, checkID, checkLnr, checkNull, checkSelStatisticsPrivilege, checkSystemOverviewPrivilege, checkUC4ObjectEmptyName, checkUC4ObjectName, createNATFor, createNATRequest, emptyAttributes, getAllMessageBoxes, getMessageBox, getRequestID, handleResponse, ignoreMessageBox, send, setMessageBox, showQuarantineNotificationpublic CheckUserPrivileges(CheckUserPrivileges.Candidate... candidates)
CheckUserPrivileges request.candidates - Candidates to testprotected void createRequest(com.uc4.util.XMLDocument doc,
org.w3c.dom.Element request,
ConnectionAttributes sessionInfo)
XMLRequestcreateRequest in class XMLRequestdoc - Document, used to create new Elementsrequest - Request Element - classes append information to this request elementsessionInfo - Information about the sessionprotected void handleContent(com.uc4.util.XMLDocument doc,
ConnectionAttributes session)
handleContent in class XMLRequestprotected java.lang.String getSrc()
XMLRequestgetSrc in class XMLRequestpublic java.util.Iterator<CheckUserPrivileges.Candidate> iterator()
iterator in interface java.lang.Iterable<CheckUserPrivileges.Candidate>public int size()
protected boolean isAllowedInClientZero()
XMLRequestXMLRequest is allowed in client 0.
The default implementation returns false, subclasses may override.isAllowedInClientZero in class XMLRequesttrue if this request is allowed in client 0, false otherwise