Class PermissionHeuristic
java.lang.Object
edu.internet2.middleware.grouper.permissions.PermissionHeuristic
this takes a permissions assignment (PermissionEntry), and gives it a score so you can find the best entry, even if it is a tie, to decide if allow or deny. Max depth resource: 30 (configurable in grouper.properties) (864000) person/role assignment (432000) direct role assignment (14400 * 30) (14400) role assignment with role depth 29 (7200) assignment to user as opposed to group (3600) direct resource assignment (120*30) (120) indirect direct resource assignment depth 29 (60) direct action assignment (2*30) (58) action depth 1 (56) action depth 2 (54) action depth 3 (2) action depth 29 (1) allow
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
which type of heuristic (not including depth) -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionget all types ordered by most importantstatic String
collectionToString
(Collection<PermissionHeuristic> permissionHeuristics) convert a collection to stringstatic PermissionHeuristics
computeHeuristics
(long score) computer heuristicsstatic long
computePermissionHeuristic
(PermissionEntry permissionEntry) compute a heuristic based on how important the aspects of the permissionEntry are see the class javadoc for more infoboolean
int
getDepth()
if this is a heuristic which has depth, then this is it, or -1type of heuristicint
hashCode()
void
setDepth
(int depth1) if this is a heuristic which has depth, then this is it, or -1void
setPermissionHeuristicType
(PermissionHeuristic.PermissionHeuristicType permissionHeuristicType1) type of heuristictoString()
-
Constructor Details
-
PermissionHeuristic
public PermissionHeuristic()
-
-
Method Details
-
getPermissionHeuristicType
type of heuristic- Returns:
- type
-
setPermissionHeuristicType
public void setPermissionHeuristicType(PermissionHeuristic.PermissionHeuristicType permissionHeuristicType1) type of heuristic- Parameters:
permissionHeuristicType1
-
-
equals
-
hashCode
public int hashCode() -
getDepth
public int getDepth()if this is a heuristic which has depth, then this is it, or -1- Returns:
- heuristic
-
setDepth
public void setDepth(int depth1) if this is a heuristic which has depth, then this is it, or -1- Parameters:
depth1
-
-
allTypesOrdered
get all types ordered by most important- Returns:
- all types
-
computeHeuristics
computer heuristics- Parameters:
score
-- Returns:
- the list of heuristics, e.g. for comparison
-
computePermissionHeuristic
compute a heuristic based on how important the aspects of the permissionEntry are see the class javadoc for more info- Parameters:
permissionEntry
-- Returns:
- the number
-
toString
-
collectionToString
convert a collection to string- Parameters:
permissionHeuristics
-- Returns:
- the string
-