Package com.atlassian.bamboo.security
Interface AnnotatedPermitChecker
- All Known Implementing Classes:
DefaultAnnotatedPermitChecker
,NoCheckAnnotatedPermitChecker
public interface AnnotatedPermitChecker
Helper class which helps to enforce com.atlassian.annotations.security annotations.
- Since:
- 10.0
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks behaviour of unannotated methods.boolean
verifyIsPermitted
(Class<?> checkingClass) Verifies is current user has access to methods in a given class.boolean
verifyIsPermitted
(Class<?> checkingClass, Method method) Verifies is current user has access to the given method.boolean
verifyIsPermitted
(Class<?> checkingClass, String checkingMethodName, Class<?>... checkingMethodParameterTypes) Verifies if current user has access to the given method..
-
Field Details
-
ANNOTATED_PERMITTED_CHECKER_ATTR
- See Also:
-
-
Method Details
-
isAllowAnonymousAccessForNotAnnotatedMembers
boolean isAllowAnonymousAccessForNotAnnotatedMembers()Checks behaviour of unannotated methods.- Returns:
- true if anonymous requests are allowed to call unannotated methods.
-
verifyIsPermitted
boolean verifyIsPermitted(Class<?> checkingClass, String checkingMethodName, Class<?>... checkingMethodParameterTypes) Verifies if current user has access to the given method..- Parameters:
checkingClass
- The class to be checked for permission.checkingMethodName
- The name of the method in the class to be checked for permission.checkingMethodParameterTypes
- Array of parameter types from the method declaration to differentiate between overloaded methods.- Returns:
false
immediately if any annotated element denies authorization. Returnstrue
under the following conditions:- Class or method allows authorization for the requesting principal. If present, the method annotation overrides the class one
- If no elements are annotated:
- If the principal is not anonymous
- For an anonymous user: If anonymous access to non-annotated classes is enabled
-
verifyIsPermitted
Verifies is current user has access to the given method.- Parameters:
checkingClass
- The class to be checked for permission.method
- The method in the action class to be checked for permission.- Returns:
false
immediately if any annotated element denies authorization. Returnstrue
under the following conditions:- Class or method allows authorization for the requesting principal. If present, the method annotation overrides the class one
- If no elements are annotated:
- If the principal is not anonymous
- For an anonymous user: If anonymous access to non-annotated classes is enabled
-
verifyIsPermitted
Verifies is current user has access to methods in a given class.- Parameters:
checkingClass
- The class to be checked for permission.- Returns:
false
if authorization is denied. Returnstrue
if- Annotated class allows authorization for the requesting principal
- If the class is not annotated:
- If the principal is not anonymous
- For an anonymous user: If anonymous access to non-annotated classes is enabled
-