@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class GetEffectiveRightsRequestControl extends Control
NOTE: This class, and other classes within the
com.unboundid.ldap.sdk.unboundidds
package structure, are only
supported for use against Ping Identity, UnboundID, and
Nokia/Alcatel-Lucent 8661 server products. These classes provide support
for proprietary functionality or for external specifications that are not
considered stable or mature enough to be guaranteed to work in an
interoperable way with other types of LDAP servers.
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. } }
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
static GetEffectiveRightsRequestControl |
decodeJSONControl(JSONObject controlObject,
boolean strict)
Attempts to decode the provided object as a JSON representation of a get
effective rights request control.
|
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.
|
JSONObject |
toJSONControl()
Retrieves a representation of this get effective rights request control as
a JSON object.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this LDAP control to the provided
buffer.
|
decode, decode, decodeControls, decodeJSONControl, deregisterDecodeableControl, encode, encodeControls, equals, getOID, getValue, hashCode, hasValue, isCritical, readFrom, registerDecodeableControl, registerDecodeableControl, toString, writeTo
@NotNull public static final java.lang.String GET_EFFECTIVE_RIGHTS_REQUEST_OID
public GetEffectiveRightsRequestControl(@NotNull java.lang.String authzID, @NotNull 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, @NotNull java.lang.String authzID, @NotNull 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(@NotNull 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.@NotNull public java.lang.String getAuthzID()
@NotNull public java.lang.String[] getAttributes()
@NotNull public java.lang.String getControlName()
getControlName
in class Control
@NotNull public JSONObject toJSONControl()
oid
-- A mandatory string field whose value is the object
identifier for this control. For the get effective rights request
control, the OID is "1.3.6.1.4.1.42.2.27.9.5.2".
control-name
-- An optional string field whose value is a
human-readable name for this control. This field is only intended for
descriptive purposes, and when decoding a control, the oid
field should be used to identify the type of control.
criticality
-- A mandatory Boolean field used to indicate
whether this control is considered critical.
value-base64
-- An optional string field whose value is a
base64-encoded representation of the raw value for this get effective
rights request control. Exactly one of the value-base64
and
value-json
fields must be present.
value-json
-- An optional JSON object field whose value is a
user-friendly representation of the value for this get effective rights
request control. Exactly one of the value-base64
and
value-json
fields must be present, and if the
value-json
field is used, then it will use the following
fields:
authorization-id
-- A mandatory string field whose value is
the authorization identity of the user for whom to retrieve the
effective rights.
attributes
-- An optional array field whose values are
strings that represent the names of the attributes for which to
make the effective rights determination.
toJSONControl
in class Control
@NotNull public static GetEffectiveRightsRequestControl decodeJSONControl(@NotNull JSONObject controlObject, boolean strict) throws LDAPException
controlObject
- The JSON object to be decoded. It must not be
null
.strict
- Indicates whether to use strict mode when decoding
the provided JSON object. If this is true
,
then this method will throw an exception if the
provided JSON object contains any unrecognized
fields. If this is false
, then unrecognized
fields will be ignored.LDAPException
- If the provided JSON object cannot be parsed as a
valid get effective rights request control.