diff --git a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/PermissionsInterceptor.java b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/PermissionsInterceptor.java index fc2a11fa..7c35753f 100644 --- a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/PermissionsInterceptor.java +++ b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/PermissionsInterceptor.java @@ -136,12 +136,7 @@ public class PermissionsInterceptor securitySystem.authorize( authenticationResult.getUser(), permission, // StringUtils.isBlank( redbackAuthorization.resource() ) // ? null : redbackAuthorization.resource() ); - /* - if ( securitySystem.isAuthorized( securitySession, permission, // - StringUtils.isBlank( redbackAuthorization.resource() ) // - ? null : redbackAuthorization.resource() ) ) - */ - if ( authenticationResult != null && authorizationResult.isAuthorized() ) + if ( authenticationResult != null && authorizationResult.isAuthorized() ) { log.debug( "isAuthorized for permission {}", permission ); return; diff --git a/redback-system/src/main/java/org/apache/archiva/redback/system/SecuritySystem.java b/redback-system/src/main/java/org/apache/archiva/redback/system/SecuritySystem.java index ad751cde..270ece75 100644 --- a/redback-system/src/main/java/org/apache/archiva/redback/system/SecuritySystem.java +++ b/redback-system/src/main/java/org/apache/archiva/redback/system/SecuritySystem.java @@ -74,6 +74,14 @@ public interface SecuritySystem AuthorizationResult authorize( SecuritySession session, String permission, String resource ) throws AuthorizationException; + /** + * @since 2.3 + * @param user + * @param permission + * @param resource + * @return + * @throws AuthorizationException + */ AuthorizationResult authorize( User user, String permission, String resource ) throws AuthorizationException;