Search in sources :

Example 1 with AccessControl

use of org.sklsft.commons.rest.security.annotations.AccessControl in project skeleton-commons by skeleton-software-community.

the class AccessControlAspect method getAccessControlType.

private AccessControlType getAccessControlType(ProceedingJoinPoint joinPoint) {
    AccessControlType accessControlType = AccessControlType.PRIVATE;
    Method proxiedMethod = ((MethodSignature) joinPoint.getSignature()).getMethod();
    AccessControl accessControl = proxiedMethod.getAnnotation(AccessControl.class);
    if (accessControl != null) {
        accessControlType = accessControl.value();
    }
    return accessControlType;
}
Also used : MethodSignature(org.aspectj.lang.reflect.MethodSignature) AccessControlType(org.sklsft.commons.rest.security.access.AccessControlType) Method(java.lang.reflect.Method) AccessControl(org.sklsft.commons.rest.security.annotations.AccessControl)

Example 2 with AccessControl

use of org.sklsft.commons.rest.security.annotations.AccessControl in project skeleton-commons by skeleton-software-community.

the class AccessControlAspect method getTokenExtractionMode.

private TokenExtractionMode getTokenExtractionMode(ProceedingJoinPoint joinPoint) {
    TokenExtractionMode tokenExtractionMode = TokenExtractionMode.HEADER;
    Method proxiedMethod = ((MethodSignature) joinPoint.getSignature()).getMethod();
    AccessControl accessControl = proxiedMethod.getAnnotation(AccessControl.class);
    if (accessControl != null) {
        tokenExtractionMode = accessControl.tokenExtractionMode();
    }
    return tokenExtractionMode;
}
Also used : MethodSignature(org.aspectj.lang.reflect.MethodSignature) TokenExtractionMode(org.sklsft.commons.rest.security.tokens.TokenExtractionMode) Method(java.lang.reflect.Method) AccessControl(org.sklsft.commons.rest.security.annotations.AccessControl)

Aggregations

Method (java.lang.reflect.Method)2 MethodSignature (org.aspectj.lang.reflect.MethodSignature)2 AccessControl (org.sklsft.commons.rest.security.annotations.AccessControl)2 AccessControlType (org.sklsft.commons.rest.security.access.AccessControlType)1 TokenExtractionMode (org.sklsft.commons.rest.security.tokens.TokenExtractionMode)1