diff --git a/docs/manual/src/docbook/secured-objects.xml b/docs/manual/src/docbook/secured-objects.xml
index 3ae40c5389..ff3800a401 100644
--- a/docs/manual/src/docbook/secured-objects.xml
+++ b/docs/manual/src/docbook/secured-objects.xml
@@ -28,7 +28,7 @@
You can of course configure a MethodSecurityIterceptor directly
in your application context for use with one of Spring AOP's proxying mechanisms:
+ class="org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor">
@@ -61,7 +61,7 @@
in the Spring application context:
+ class="org.springframework.security.access.intercept.aspectj.AspectJSecurityInterceptor">
@@ -92,38 +92,40 @@ import org.springframework.beans.factory.InitializingBean;
public aspect DomainObjectInstanceSecurityAspect implements InitializingBean {
-private AspectJSecurityInterceptor securityInterceptor;
+ private AspectJSecurityInterceptor securityInterceptor;
-pointcut domainObjectInstanceExecution(): target(PersistableEntity)
- && execution(public * *(..)) && !within(DomainObjectInstanceSecurityAspect);
+ pointcut domainObjectInstanceExecution(): target(PersistableEntity)
+ && execution(public * *(..)) && !within(DomainObjectInstanceSecurityAspect);
-Object around(): domainObjectInstanceExecution() {
- if (this.securityInterceptor == null) {
- return proceed();
- }
+ Object around(): domainObjectInstanceExecution() {
+ if (this.securityInterceptor == null) {
+ return proceed();
+ }
- AspectJCallback callback = new AspectJCallback() {
- public Object proceedWithObject() {
- return proceed();
- }
- };
+ AspectJCallback callback = new AspectJCallback() {
+ public Object proceedWithObject() {
+ return proceed();
+ }
+ };
- return this.securityInterceptor.invoke(thisJoinPoint, callback);
-}
+ return this.securityInterceptor.invoke(thisJoinPoint, callback);
+ }
-public AspectJSecurityInterceptor getSecurityInterceptor() {
- return securityInterceptor;
-}
+ public AspectJSecurityInterceptor getSecurityInterceptor() {
+ return securityInterceptor;
+ }
-public void setSecurityInterceptor(AspectJSecurityInterceptor securityInterceptor) {
- this.securityInterceptor = securityInterceptor;
-}
+ public void setSecurityInterceptor(AspectJSecurityInterceptor securityInterceptor) {
+ this.securityInterceptor = securityInterceptor;
+ }
-public void afterPropertiesSet() throws Exception {
- if (this.securityInterceptor == null)
- throw new IllegalArgumentException("securityInterceptor required");
- }
-}
+ public void afterPropertiesSet() throws Exception {
+ if (this.securityInterceptor == null)
+ throw new IllegalArgumentException("securityInterceptor required");
+ }
+ }
+}
+
In the above example, the security interceptor will be applied to every instance of
PersistableEntity, which is an abstract class not shown (you can use any
other class or pointcut expression you like). For those curious,
@@ -136,8 +138,8 @@ public void afterPropertiesSet() throws Exception {
shown below:
+ class="org.springframework.security.samples.aspectj.DomainObjectInstanceSecurityAspect"
+ factory-method="aspectOf">
]]>