|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unboundid.ldap.sdk.Control
com.unboundid.ldap.sdk.unboundidds.controls.GetEffectiveRightsRequestControl
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class GetEffectiveRightsRequestControl
NOTE: This class is part of the Commercial Edition of the UnboundID LDAP SDK for Java. It is not available for use in applications that include only the Standard Edition of the LDAP SDK, and is not supported for use in conjunction with non-UnboundID products.This class provides an implementation of the get effective rights request control, which may be included in a search request to indicate that matching entries should include information about the rights a given user may have when interacting with that entry.
aclRights
operational
attribute. Note that because this is an operational attribute, it must be
explicitly included in the set of attributes to return.
aclRights
attribute is included in the entry, then it will be
present with multiple sets of options. In one case, it will have an option
of "entryLevel", which provides information about the rights that the user
has for the entry in general (see the EntryRight
enum for a list of
the entry-level rights that can be held). In all other cases, it will have
one option of "attributeLevel" and another option that is the name of the
attribute for which the set of rights is granted (see the
AttributeRight
enum for a list of the attribute-level rights that can
be held). In either case, the value will be a comma-delimited list of
right strings, where each right string is the name of the right followed by
a colon and a one to indicate that the right is granted or zero to indicate
that it is not granted. The EffectiveRightsEntry
class provides a
simple means of accessing the information encoded in the values of the
aclRights
attribute.
GET_EFFECTIVE_RIGHTS := SEQUENCE { authzID authzID, attributes SEQUENCE OF AttributeType OPTIONAL }
SearchRequest searchRequest = new SearchRequest("dc=example,dc=com", SearchScope.SUB, Filter.createEqualityFilter("uid", "john.doe"), "userPassword", "aclRights"); searchRequest.addControl(new GetEffectiveRightsRequestControl( "dn:uid=admin,dc=example,dc=com")); SearchResult searchResult = connection.search(searchRequest); for (SearchResultEntry entry : searchResult.getSearchEntries()) { EffectiveRightsEntry effectiveRightsEntry = new EffectiveRightsEntry(entry); if (effectiveRightsEntry.rightsInformationAvailable()) { if (effectiveRightsEntry.hasAttributeRight(AttributeRight.WRITE, "userPassword")) { // The admin user has permission to change the target user's password. } else { // The admin user does not have permission to change the target user's // password. } } else { // No effective rights information was returned. } }
Field Summary | |
---|---|
static java.lang.String |
GET_EFFECTIVE_RIGHTS_REQUEST_OID
The OID (1.3.6.1.4.1.42.2.27.9.5.2) for the get effective rights request control. |
Constructor Summary | |
---|---|
GetEffectiveRightsRequestControl(boolean isCritical,
java.lang.String authzID,
java.lang.String... attributes)
Creates a new get effective rights request control with the provided information. |
|
GetEffectiveRightsRequestControl(Control control)
Creates a new get effective rights request control which is decoded from the provided generic control. |
|
GetEffectiveRightsRequestControl(java.lang.String authzID,
java.lang.String... attributes)
Creates a new get effective rights request control with the provided information. |
Method Summary | |
---|---|
java.lang.String[] |
getAttributes()
Retrieves the names of the attributes for which to calculate the effective rights information. |
java.lang.String |
getAuthzID()
Retrieves the authorization ID of the user for whom to calculate the effective rights. |
java.lang.String |
getControlName()
Retrieves the user-friendly name for this control, if available. |
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this LDAP control to the provided buffer. |
Methods inherited from class com.unboundid.ldap.sdk.Control |
---|
decode, decode, decodeControls, deregisterDecodeableControl, encode, encodeControls, equals, getOID, getValue, hashCode, hasValue, isCritical, readFrom, registerDecodeableControl, toString, writeTo |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String GET_EFFECTIVE_RIGHTS_REQUEST_OID
Constructor Detail |
---|
public GetEffectiveRightsRequestControl(java.lang.String authzID, java.lang.String... attributes)
authzID
- The authorization ID of the user for whom the effective
rights should be calculated. It must not be
null
.attributes
- The set of attributes for which to calculate the
effective rights.public GetEffectiveRightsRequestControl(boolean isCritical, java.lang.String authzID, java.lang.String... attributes)
isCritical
- Indicates whether this control should be marked
critical.authzID
- The authorization ID of the user for whom the effective
rights should be calculated. It must not be
null
.attributes
- The set of attributes for which to calculate the
effective rights.public GetEffectiveRightsRequestControl(Control control) throws LDAPException
control
- The generic control to be decoded as a get effective
rights request control.
LDAPException
- If the provided control cannot be decoded as a get
effective rights request control.Method Detail |
---|
public java.lang.String getAuthzID()
public java.lang.String[] getAttributes()
public java.lang.String getControlName()
getControlName
in class Control
public void toString(java.lang.StringBuilder buffer)
toString
in class Control
buffer
- The buffer to which to append the string representation of
this buffer.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |