Skip to content

AuthorizationAnnotationUtils.findUniqueAnnotation broken for inherithed repository methods #13234

Closed
@hqrd

Description

@hqrd

This issue is similar to #13132
But for repository methods going through proxies.

Example code :

@NoRepositoryBean
@RepositoryRestResource
public interface DefaultCrudRepository<T, K> extends JpaRepository<T, K> {
	@PreAuthorize(SUPPORT_ROLE_RULE_FOR_CRUD)
	@Override
	@RestResource
	@NonNull
	<S extends T> S save(@NonNull S entity);

}

Then in AuthorizationAnnotationUtils#findUniqueAnnotation, the mergedAnnotations contains 2 PreAuthorize :
image

Which results in an AnnotationConfigurationException

Metadata

Metadata

Assignees

Labels

in: coreAn issue in spring-security-core

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions