Skip to content

Commit

Permalink
Grails 7: (grails#46) add notable changes to README.md for the 5.0.x …
Browse files Browse the repository at this point in the history
…version of the plugin
  • Loading branch information
bkoehm committed Dec 4, 2024
1 parent 67f313d commit 8d81f9a
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,45 @@ See [documentation](https://grails-plugins.github.io/grails-spring-security-acl/

To run the tests exeucte:

`./gradlew -Dgeb.env=chromeHeadless check`
`./gradlew -Dgeb.env=chromeHeadless check`

## v5.0.0 changes

### Caching

The default cache manager has changed to
[JCacheCacheManager](https://docs.spring.io/spring-framework/docs/6.2.0/javadoc-api/org/springframework/cache/jcache/JCacheCacheManager.html).

### Method parameter discovery

The behavior of parameter discovery has changed to align with
[Spring Security 6 default](https://docs.spring.io/spring-security/site/docs/6.4.1/api//org/springframework/security/core/parameters/DefaultSecurityParameterNameDiscoverer.html)
behavior. This may require code changes if you are utilizing ACL
annotations that reference method parameters. You will need to add the
[P](https://docs.spring.io/spring-security/site/docs/6.4.1/api/org/springframework/security/core/parameters/P.html)
annotation to reference method parameters. This is documented in the
Spring Security reference doc under the
[Using Method Parameters](https://docs.spring.io/spring-security/reference/servlet/authorization/method-security.html#using_method_parameters)
section.

Previously if you had code similar to:
```
@PreAuthorize("hasPermission(#contract, 'write')")
public void updateContact(Contact contact) {
...
}
```

This should be changed to:

```
import org.springframework.security.core.parameters.P
@PreAuthorize("hasPermission(#contract, 'write')")
public void updateContact(@P("contract") Contact contact) {
...
}
```

Since parameter `contract` is referenced in the `@PreAuthorize` annotation, it
should now be annotated with `@P`.

0 comments on commit 8d81f9a

Please sign in to comment.