Spring Security
  1. Spring Security
  2. SEC-1232

<global-method-security mode="aspectj"/>

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 3.0.0 M2
    • Fix Version/s: 3.0.3, 3.1.0.M1
    • Component/s: Namespace
    • Labels:
      None

      Description

      Using AspectJ instead of Spring AOP, similar to the way it is used in Spring's tx namespace would be great

        Activity

        Hide
        Mike Wiesner added a comment -

        The classes to use a Aspect library instead of writing your AspectJ aspect yourself are now available and they can be used with normal bean definitions (see the aspectj sample). Integration in the Namespace will follow.

        Show
        Mike Wiesner added a comment - The classes to use a Aspect library instead of writing your AspectJ aspect yourself are now available and they can be used with normal bean definitions (see the aspectj sample). Integration in the Namespace will follow.
        Hide
        Bram Walet added a comment -

        Hello Mike,

        I have extended your sample to include support for @PreFilter, @PreAuthorize, @PostFilter and @PostAuthorize annotations.
        This code is based on the forum post here: http://forum.springsource.org/showpost.php?p=270335&postcount=13. I have included test cases in the samples-aspectj including my example bean configuration to provide @Secured and @Pre/Post,Filter/Authorize support at the same time.

        Show
        Bram Walet added a comment - Hello Mike, I have extended your sample to include support for @PreFilter, @PreAuthorize, @PostFilter and @PostAuthorize annotations. This code is based on the forum post here: http://forum.springsource.org/showpost.php?p=270335&postcount=13 . I have included test cases in the samples-aspectj including my example bean configuration to provide @Secured and @Pre/Post,Filter/Authorize support at the same time.
        Hide
        Luke Taylor added a comment -

        Namespace support has now also been added. Support for @Pre, @Post etc was added as part of a separate issue so should already be working.

        Show
        Luke Taylor added a comment - Namespace support has now also been added. Support for @Pre, @Post etc was added as part of a separate issue so should already be working.
        Hide
        Grzegorz Borkowski added a comment -

        In which Spring-Security module the aspects for compile time weaving are kept? We use the compile time weaving for Spring transaction managament, it's as simple as configuring the aspect library to weave in maven pom file:
        <aspectLibrary>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aspects</artifactId>
        </aspectLibrary>
        But I can't find such module with method-security aspects in Spring Security. Maybe because it's not in SS 3.0.2, only in 3.0.3?
        BTW: I'd really like to test this functionality soon. Is 3.0.3 expected to be realeased soon? If not, is it possible to obtain snapshots from any maven repository? I've tried plugging in different maven repositories (as described here: http://blog.springsource.com/2009/12/02/obtaining-spring-3-artifacts-with-maven/) but with no luck. Do you use "3.0.3.BUILD-SNAPSHOT" version number for snapshots?

        Show
        Grzegorz Borkowski added a comment - In which Spring-Security module the aspects for compile time weaving are kept? We use the compile time weaving for Spring transaction managament, it's as simple as configuring the aspect library to weave in maven pom file: <aspectLibrary> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> </aspectLibrary> But I can't find such module with method-security aspects in Spring Security. Maybe because it's not in SS 3.0.2, only in 3.0.3? BTW: I'd really like to test this functionality soon. Is 3.0.3 expected to be realeased soon? If not, is it possible to obtain snapshots from any maven repository? I've tried plugging in different maven repositories (as described here: http://blog.springsource.com/2009/12/02/obtaining-spring-3-artifacts-with-maven/ ) but with no luck. Do you use "3.0.3.BUILD-SNAPSHOT" version number for snapshots?
        Show
        Luke Taylor added a comment - The module is spring-security-aspects. https://s3browse.springsource.com/browse/maven.springframework.org/snapshot/org/springframework/security/spring-security-aspects/
        Hide
        Grzegorz Borkowski added a comment -

        Thanks. I also found out the the version is named CI-SNAPSHOT, not BUILD-SNAPSHOT.
        But still there is sth wrong. If I add such dependency into pom:
        <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-aspects</artifactId>
        <version>3.1.0.CI-SNAPSHOT</version>
        </dependency>
        then it builds properly. But if I use version 3.0.3.CI-SNAPSHOT:
        <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-aspects</artifactId>
        <version>3.0.3.CI-SNAPSHOT</version>
        </dependency>
        than build fails, claiming "failed to resolve artifact org.springframework.security:spring-security-aspects:jar:3.0.3.CI-SNAPSHOT".
        So it looks like 3.1.0.CI-SNAPSHOT version of aspects module is available from spring maven repository, but 3.0.3.CI-SNAPSHOT is not.

        Show
        Grzegorz Borkowski added a comment - Thanks. I also found out the the version is named CI-SNAPSHOT, not BUILD-SNAPSHOT. But still there is sth wrong. If I add such dependency into pom: <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-aspects</artifactId> <version>3.1.0.CI-SNAPSHOT</version> </dependency> then it builds properly. But if I use version 3.0.3.CI-SNAPSHOT: <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-aspects</artifactId> <version>3.0.3.CI-SNAPSHOT</version> </dependency> than build fails, claiming "failed to resolve artifact org.springframework.security:spring-security-aspects:jar:3.0.3.CI-SNAPSHOT". So it looks like 3.1.0.CI-SNAPSHOT version of aspects module is available from spring maven repository, but 3.0.3.CI-SNAPSHOT is not.
        Hide
        Grzegorz Borkowski added a comment -

        Well, it's actually visible on the link you provided: there is only 3.1.0 version there.

        Show
        Grzegorz Borkowski added a comment - Well, it's actually visible on the link you provided: there is only 3.1.0 version there.
        Hide
        Jonathan Su added a comment -

        Is there a 3.0.3 RELEASE version for the spring-security-aspect module?

        Show
        Jonathan Su added a comment - Is there a 3.0.3 RELEASE version for the spring-security-aspect module?
        Hide
        Sylvain LAURENT added a comment -

        still not available for 3.0.4.RELEASE (

        Show
        Sylvain LAURENT added a comment - still not available for 3.0.4.RELEASE (

          People

          • Assignee:
            Luke Taylor
            Reporter:
            Mike Wiesner
          • Votes:
            4 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: