Package com.isode.dsapi.aci
Class SimpleACIRule.Tuple
java.lang.Object
com.isode.dsapi.aci.SimpleACIRule.Tuple
- Enclosing class:
- SimpleACIRule
Representation of one rule tuple
The fields of this class may be accessed directly. There are also methods available to simplify access to some of the fields.
-
Field Summary
FieldsModifier and TypeFieldDescriptionLabel of this rule tuple.int
Permissions bit-set; each bit is 0 for off, 1 for on.boolean
Protect access to all user attribute types.boolean
Protect access to all user attribute types and also their values.boolean
Protect entry access.Protect access to the specific attribute value, within the listed attributes, that matches the user's bound DN.Protect access to the given list of user attribute types, either just the types, or types-and-values according toprot_type_values
.boolean
Modifier forprot_type
: 'true' to protect attribute types-and-values, or 'false' to protect just the types.If an objectclass filter is specified here, then the rule is only applied to entries that match.boolean
If 'true', only applies to subentries of admin points.boolean
If 'true', rule applies only to the user's own entry: that is, the entry with the same DN as the user's DN. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear all permission bits.void
clearPermBits
(PermBit... bits) Clear one or more permission bits.boolean
Test whether two rules are identical, apart from their names.int
Return a hashCode that depends on the 'contents' of the rule tuple, but not the name.void
Copy data from the given tuple.deepCopy()
Copy this tuple, but not the 'original' reference.void
dumpXML
(com.isode.util.XMLOutput out) Dump tuple as XML.boolean
Test whether two tuples are identical.Get the original Tuple, that was set withsetOriginal(com.isode.dsapi.aci.SimpleACIRule.Tuple)
.boolean
Test whether there have been changes compared to the original tuple.int
hashCode()
Return a hashCode that depends on both the 'contents' and the name of the rule tuple.static SimpleACIRule.Tuple
loadXML
(com.isode.util.XMLInput in) Try to load tuple from XML.void
Protect all user attributes.void
protectAttrs
(String... attrs) Protect the given list of attribute types and also their values.void
Protect all of the standard Isode base list of operational attributes that a user would need to read, or a manager need to modify.void
Protect all of the standard Isode base list of operational attributes that a user would need to read, or a manager need to modify in R15.void
protectSelfAttrs
(String... attrs) Protect the given list of attributes in the user's own entry.void
Set all the permission bits related to attribute access-control.void
Set all the permission bits related to entry access-control.void
Set the read-related permission bits for attribute access control, that is: read, compare, match and disclose-on-error.void
Set the change-related permission bits for entry access control, that is: add, remove and modify.void
Set the read-related permission bits for entry access control, that is: read, browse, return-DN and disclose-on-error.void
Set the rename-related permission bits for entry access control, that is: rename, import and export.void
Set the original Tuple.void
setPermBits
(PermBit... bits) Set one or more permission bits.void
sort()
Sort the protected attribute names into a consistent order.toString()
Debugging dump.
-
Field Details
-
label
Label of this rule tuple. -
permissions
public int permissionsPermissions bit-set; each bit is 0 for off, 1 for on. On means 'grant' or 'deny' depending on whether this is a grant or deny rule. Off means 'unaffected'. Bit values are specified in thePermBit
enumeration. -
prot_entry
public boolean prot_entryProtect entry access. This must not be set 'true' in combination with any of the other prot_* variables. This keeps entry-level permissions separate from attribute-level permissions. -
prot_all_type
public boolean prot_all_typeProtect access to all user attribute types. -
prot_all_type_value
public boolean prot_all_type_valueProtect access to all user attribute types and also their values. Implies 'prot_all_type' even if it isn't explicitly set. -
prot_type
Protect access to the given list of user attribute types, either just the types, or types-and-values according toprot_type_values
. -
prot_type_values
public boolean prot_type_valuesModifier forprot_type
: 'true' to protect attribute types-and-values, or 'false' to protect just the types. -
prot_self
Protect access to the specific attribute value, within the listed attributes, that matches the user's bound DN. -
subentry
public boolean subentryIf 'true', only applies to subentries of admin points. Otherwise applies to normal entries.If 'true', then the anticipated use is that the subentry permissions would be set for a wide area, and that any ACSAs within that area would pick up those permissions. It is not necessary to specify a separate region for each ACSA.
-
refinement
If an objectclass filter is specified here, then the rule is only applied to entries that match. Use 'null' if no objectclass filter is required. -
user_entry
public boolean user_entryIf 'true', rule applies only to the user's own entry: that is, the entry with the same DN as the user's DN. The role used in combination with this rule must specify 'user_all' or otherwise the combination will be rejected.
-
-
Constructor Details
-
Tuple
Construct a tuple with the given label.- Parameters:
label
- Name of tuple
-
-
Method Details
-
setPermBits
Set one or more permission bits.- Parameters:
bits
- Array or argument-list of PermBits to set
-
clearPermBits
Clear one or more permission bits.- Parameters:
bits
- Array or argument-list of PermBits to clear
-
clearAllPermBits
public void clearAllPermBits()Clear all permission bits. -
setAllEntryPermBits
public void setAllEntryPermBits()Set all the permission bits related to entry access-control. -
setEntryReadPermBits
public void setEntryReadPermBits()Set the read-related permission bits for entry access control, that is: read, browse, return-DN and disclose-on-error. -
setEntryChangePermBits
public void setEntryChangePermBits()Set the change-related permission bits for entry access control, that is: add, remove and modify. -
setEntryRenamePermBits
public void setEntryRenamePermBits()Set the rename-related permission bits for entry access control, that is: rename, import and export. -
setAllAttrPermBits
public void setAllAttrPermBits()Set all the permission bits related to attribute access-control. -
setAttrReadPermBits
public void setAttrReadPermBits()Set the read-related permission bits for attribute access control, that is: read, compare, match and disclose-on-error. -
protectAllUserAttrs
public void protectAllUserAttrs()Protect all user attributes. Sets 'prot_all_type' and 'prot_all_type_value' to true. -
protectAttrs
Protect the given list of attribute types and also their values. Adds these attributes to 'prot_type' and sets 'prot_type_values'.- Parameters:
attrs
- Array or argument-list of attribute type names to protect
-
protectBaseOpAttrs
public void protectBaseOpAttrs()Protect all of the standard Isode base list of operational attributes that a user would need to read, or a manager need to modify. Adds this list to 'prot_type' and sets 'prot_type_values'. -
protectR15OpAttrs
public void protectR15OpAttrs()Protect all of the standard Isode base list of operational attributes that a user would need to read, or a manager need to modify in R15. Adds this list to 'prot_type' and sets 'prot_type_values'. -
protectSelfAttrs
Protect the given list of attributes in the user's own entry. Adds these attributes to 'prot_self'.- Parameters:
attrs
- Array or argument-list of attribute type names to protect
-
deepCopy
Copy this tuple, but not the 'original' reference. This is cheap slow code -- it copies it by converting it via XML. It could perhaps be improved if there was ever a need to do a lot of copying. -
sort
public void sort()Sort the protected attribute names into a consistent order. If all Tuple instances are sorted, then .equals() and .contentsEqual() will work consistently even if the tuples were originally loaded in a different order. Otherwise comparisons are sensitive to the loading order. -
contentsEqual
Test whether two rules are identical, apart from their names.- Parameters:
bb
- Tuple to compare to- Returns:
- Test result
-
setOriginal
Set the original Tuple. This is only used to supporthasChanges()
. -
getOriginal
Get the original Tuple, that was set withsetOriginal(com.isode.dsapi.aci.SimpleACIRule.Tuple)
. -
hasChanges
public boolean hasChanges()Test whether there have been changes compared to the original tuple. The tuple is sorted internally to allow the comparison. If the original tuple was not set, this method returns false.- Returns:
- TRUE if there have been changes compared to the original tuple; FALSE otherwise or if the original tuple was not set.
-
equals
Test whether two tuples are identical. -
contentsHashCode
public int contentsHashCode()Return a hashCode that depends on the 'contents' of the rule tuple, but not the name.- Returns:
- Hash code
-
hashCode
public int hashCode()Return a hashCode that depends on both the 'contents' and the name of the rule tuple. -
dumpXML
Dump tuple as XML.- Throws:
IOException
-
loadXML
Try to load tuple from XML. Return null if not found. -
copyFrom
Copy data from the given tuple.- Parameters:
tup
- Tuple to copy data from, must not be null.
-
toString
Debugging dump.
-