Revert "Mark targetDomainObject as @Nullable in PermissionEvaluator"

This reverts commit 9f1381c382515042b348078cbe53f412e39c38e1.
This commit is contained in:
Robert Winch 2026-02-24 09:40:54 -06:00
parent 9f1381c382
commit ac06067d02
No known key found for this signature in database
2 changed files with 2 additions and 5 deletions

View File

@ -18,8 +18,6 @@ package org.springframework.security.access;
import java.io.Serializable;
import org.jspecify.annotations.Nullable;
import org.springframework.aop.framework.AopInfrastructureBean;
import org.springframework.security.core.Authentication;
@ -41,7 +39,7 @@ public interface PermissionEvaluator extends AopInfrastructureBean {
* expression system. Not null.
* @return true if the permission is granted, false otherwise
*/
boolean hasPermission(Authentication authentication, @Nullable Object targetDomainObject, Object permission);
boolean hasPermission(Authentication authentication, Object targetDomainObject, Object permission);
/**
* Alternative method for evaluating a permission where only the identifier of the

View File

@ -20,7 +20,6 @@ import java.io.Serializable;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jspecify.annotations.Nullable;
import org.springframework.core.log.LogMessage;
import org.springframework.security.access.PermissionEvaluator;
@ -41,7 +40,7 @@ public class DenyAllPermissionEvaluator implements PermissionEvaluator {
* @return false always
*/
@Override
public boolean hasPermission(Authentication authentication, @Nullable Object target, Object permission) {
public boolean hasPermission(Authentication authentication, Object target, Object permission) {
this.logger.warn(LogMessage.format("Denying user %s permission '%s' on object %s", authentication.getName(),
permission, target));
return false;