Interface AuthorizationConstraint
- All Known Subinterfaces:
EndUserAuthorizationConstraint
public interface AuthorizationConstraint
Encapsulates the authorization constraints that restrict access to a given
resource.
- Author:
- cdivilly
-
Method Summary
Modifier and TypeMethodDescriptionbooleanauthorized(Principal principal) Determines if aPrincipalis authorized to access this privilege.Returns the authenticationAuthenticationChallenges that are bound to this constraint.booleanAllAuthorizationConstraintimplementations MUST implement theObject.equals(Object)method correctly.booleanequals(AuthorizationConstraint constraint) AllAuthorizationConstraintimplementations MUST implement theequals(AuthorizationConstraint)method correctly.inthashCode()AllAuthorizationConstraintimplementations MUST implement theObject.hashCode()method correctly.name()The unique name assigned to this constraint.
-
Method Details
-
name
String name()The unique name assigned to this constraint. It is an error for more than oneAuthorizationConstraintto share the same name.- Returns:
- The name
-
challenges
AuthenticationChallenge[] challenges()Returns the authenticationAuthenticationChallenges that are bound to this constraint.- Returns:
- Array of
AuthenticationChallengeinstances that the constraint is bound to
-
authorized
Determines if aPrincipalis authorized to access this privilege.- Parameters:
principal- ThePrincipalto test for authorization- Returns:
- true if the principal is authorized to access the resource, false otherwise
-
equals
AllAuthorizationConstraintimplementations MUST implement theObject.equals(Object)method correctly. Typical implementations of this method should check if the specified object is an instance ofAuthorizationConstraint. If it is then delegate toequals(AuthorizationConstraint). If not then return false. -
equals
AllAuthorizationConstraintimplementations MUST implement theequals(AuthorizationConstraint)method correctly. Typical implementations of this method should check if the specified object is an instance of the same sub-type ofAuthorizationConstraint. If it is then compare each of the properties of the sub-type for equality. If it is not of the same sub-type then return false.- Parameters:
constraint- TheAuthorizationConstraintto test for equality- Returns:
- true if this instance and the specified instance are equal.
-
hashCode
int hashCode()AllAuthorizationConstraintimplementations MUST implement theObject.hashCode()method correctly.
-