DeltaSpike
  1. DeltaSpike
  2. DELTASPIKE-126

Include SecurityParameterBinding support for SecurityBindingType feature

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.2-incubating
    • Component/s: Security-Module
    • Labels:
      None

      Description

      Allows access to the business method invocation arguments in the bound security interceptor method.

          @SecurityBindingType
          public @interface ProjectAdmin
          {
              // empty
          }
      
          @SecurityParameterBinding
          public @interface ProjectBinding
          {
              // empty
          }
      
          @ProjectAdmin
          public void updateName(@ProjectBinding Project p, String name)
          {
             // save project name
          }
      
          @Secures
          @ProjectAdmin
          public boolean isProjectAdmin(@ProjectBinding Project p, Identity identity)
          {
             if(identity.hasRole("project" + p.getId() + "_admin")
             {
                 ...
             }
          }
      

      Note that the @Project annotation is not a CDI bean Qualifier / Stereotype annotation, it is a method parameter security binding annotation that tells Security to use the value of the Project passed to the method call in the security binding check itself.

        Issue Links

          Activity

          Lincoln Baxter III created issue -
          Hide
          Lincoln Baxter III added a comment -

          Please assign this issue to me, thanks! (Should I be able to assign it to myself?)

          ~Lincoln

          Show
          Lincoln Baxter III added a comment - Please assign this issue to me, thanks! (Should I be able to assign it to myself?) ~Lincoln
          Lincoln Baxter III made changes -
          Field Original Value New Value
          Description Allows access to the business method invocation arguments in the bound security interceptor method.

          {code}
              @SecurityBinding
              public @interface ProjectAdmin
              {
                  // empty
              }

              @SecurityMethodBinding
              public @interface ProjectBinding
              {
                  // empty
              }

              @ProjectAdmin
              public void updateName(@ProjectBinding Project p, String name)
              {
                 // save project name
              }

              @Secures
              @ProjectAdmin
              public boolean isProjectAdmin(@ProjectBinding Project p, Identity identity)
              {
                 if(identity.hasRole("project" + p.getId() + "_admin")
                 {
                     ...
                 }
              }
          {code}

          Note that the @Project annotation is not a CDI bean Qualifier / Stereotype annotation, it is a method parameter security binding annotation that tells Security to use the value of the Project passed to the method call in the security binding check itself.
          Allows access to the business method invocation arguments in the bound security interceptor method.

          {code}
              @SecurityBindingType
              public @interface ProjectAdmin
              {
                  // empty
              }

              @SecurityParameterBinding
              public @interface ProjectBinding
              {
                  // empty
              }

              @ProjectAdmin
              public void updateName(@ProjectBinding Project p, String name)
              {
                 // save project name
              }

              @Secures
              @ProjectAdmin
              public boolean isProjectAdmin(@ProjectBinding Project p, Identity identity)
              {
                 if(identity.hasRole("project" + p.getId() + "_admin")
                 {
                     ...
                 }
              }
          {code}

          Note that the @Project annotation is not a CDI bean Qualifier / Stereotype annotation, it is a method parameter security binding annotation that tells Security to use the value of the Project passed to the method call in the security binding check itself.
          Mark Struberg made changes -
          Assignee Gerhard Petracek [ gpetracek ] Lincoln Baxter III [ lincolnbaxter ]
          Hide
          Gerhard Petracek added a comment -

          you are in the committers group -> you basically have the permission to do it.

          regards,
          gerhard

          Show
          Gerhard Petracek added a comment - you are in the committers group -> you basically have the permission to do it. regards, gerhard
          Gerhard Petracek made changes -
          Link This issue is related to DELTASPIKE-69 [ DELTASPIKE-69 ]
          Hide
          Lincoln Baxter III added a comment -

          All done. Integrated into security module + many tests.

          Show
          Lincoln Baxter III added a comment - All done. Integrated into security module + many tests.
          Lincoln Baxter III made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Gerhard Petracek made changes -
          Link This issue incorporates DELTASPIKE-143 [ DELTASPIKE-143 ]
          Gerhard Petracek made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Gerhard Petracek made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Gerhard Petracek made changes -
          Assignee (d) Lincoln Baxter III [ lincolnbaxter ] Lincoln Baxter III [ lincolnthree ]
          Hide
          Mark Struberg added a comment -

          shipped in deltaspike-0.2-incubating

          Show
          Mark Struberg added a comment - shipped in deltaspike-0.2-incubating
          Mark Struberg made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          9d 12h 25m 1 Lincoln Baxter III 29/Mar/12 18:37
          Closed Closed Reopened Reopened
          15d 5h 1m 1 Gerhard Petracek 13/Apr/12 23:38
          Reopened Reopened Resolved Resolved
          34s 1 Gerhard Petracek 13/Apr/12 23:39
          Resolved Resolved Closed Closed
          8d 16h 44m 1 Mark Struberg 22/Apr/12 16:23

            People

            • Assignee:
              Lincoln Baxter III
              Reporter:
              Lincoln Baxter III
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development