Class ACITuple
Note that some aspects of the tuples are modified in conversion from the original ACIItems, which means that the ACDF (access control decision function) works slightly differently on them. In particular, authentication level is converted into the list of permitted levels (as booleans).
Also the confusing case of non-all-users userClasses combined with non-ANON authentication level for deny rules is not permitted in instances of this class (it must be represented as two independent rules if necessary), meaning that there will never be a deny rule that would be retained for one reason and not for the other in X.501 18.8.3 (1) part 2, which means that the two tests can be applied as discard rules independently. (Putting that another way, this means that these ACITuple instances have 'orthogonal variables' for filtering, whereas the original ACIItem rules don't.)
Certain things aren't handled here from the original ACI:
- 'other' and 'localqualifier' in the AuthenticationLevel.
- 'uid' for names and groups is not supported.
- Only 'entry', 'allUserAttributeTypes', 'allUserAttributeTypesAndValues', 'attributeType', 'allAttributeValues' and 'selfValue' protected entities are supported.
Note that ACITuples are immutable, which means that the limit*() calls may return the exact same ACITuple if no changes are required to it.
Note that there are six aspects of the ACITuple that can be limited or tested: region, permissions, auth-level, signed, user and protected-items. The limit*() calls limit the view of one aspect of the rule, returning a new ACITuple describing the result. The test*() calls test an aspect of a rule, but don't change the ACITuple in any way.
- Author:
- jp
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Authentication level enumeration.static enum
Operations. -
Constructor Summary
ConstructorsConstructorDescriptionConstruct by copying an existing MutableACITuple. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Convert an ACIItem into a number of ACITuples added to the given list.boolean
boolean
boolean
boolean
Create a mutable copy.int
int
boolean
boolean
boolean
boolean
boolean
Limit the permissions to those which affect the given operation.limitRegion
(ACIRegion reg) Limit the view of the rule to what intersects with the given region.boolean
testAuth
(ACITuple.AuthLevel level) Test whether this ACITuple applies to the given auth-level.int
testPermission
(PermBit perm) Test whether this ACITuple gives a grant or denial for the given permission bit.int
testPermission
(PermBit perm, boolean for_entry) Test whether this ACITuple gives a grant or denial for the given permission bit for the given class (entry or attribute).boolean
testRegion
(DN dn) Test whether this ACITuple applies to the given DN according to its region.boolean
testSource
(DN dn) Test whether this rule was sourced from the entry with the given DN.toString()
Generate a debugging string.
-
Constructor Details
-
ACITuple
Construct by copying an existing MutableACITuple.- Throws:
BadValueException
-
-
Method Details
-
getMutableCopy
Create a mutable copy. -
getSource
-
getRulename
-
getPrecedence
public int getPrecedence() -
getRegion
-
getIsGrant
public boolean getIsGrant() -
getPermissions
public int getPermissions() -
getAuthStrong
public boolean getAuthStrong() -
getAuthSimple
public boolean getAuthSimple() -
getAuthAnon
public boolean getAuthAnon() -
getUserAll
public boolean getUserAll() -
getUserThis
public boolean getUserThis() -
getUserNames
-
getUserGroups
-
getUserSubtrees
-
getProtEntry
public boolean getProtEntry() -
getProtAllType
public boolean getProtAllType() -
getProtAllTypeValue
public boolean getProtAllTypeValue() -
getProtType
-
getProtTypeValue
-
getProtSelf
-
convert
public static void convert(BAC.ACIItem item, ACIRegion region, DN source, List<ACITuple> list, List<String> errors) Convert an ACIItem into a number of ACITuples added to the given list. The maximum number added is 2 or 3 per rule in the ACIItem. The maximum of three per rule is reached by a tuple for both grant and deny, plus an additional tuple if the deny rule has both userClasses and auth-levels present that need separating. If there are any problems converting the ACIItem, then error-strings are added to the 'errors' list. If there are errors then the ACITuples added will probably be an incomplete mapping of the original ACIItem, so shouldn't be used. -
testSource
Test whether this rule was sourced from the entry with the given DN. -
testRegion
Test whether this ACITuple applies to the given DN according to its region. -
limitRegion
Limit the view of the rule to what intersects with the given region. Return a suitable ACITuple, or null of there is no ACITuple remaining.- Throws:
BadValueException
- If it was not possible to represent the result.
-
testPermission
Test whether this ACITuple gives a grant or denial for the given permission bit. Returns -1 denial, 0 unspecified, 1 grant. -
testPermission
Test whether this ACITuple gives a grant or denial for the given permission bit for the given class (entry or attribute). Returns -1 denial, 0 unspecified, 1 grant.- Parameters:
perm
- PermBit to testfor_entry
- For entry-level access (true) or attribute-level access (false)
-
limitForOperation
Limit the permissions to those which affect the given operation. Return a suitable ACITuple, or null of there is no ACITuple remaining. -
testAuth
Test whether this ACITuple applies to the given auth-level. -
toString
Generate a debugging string.
-