Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.3
    • Fix Version/s: 1.0.4
    • Component/s: Core
    • Labels:
      None

      Description

      examples:

      #1:

      //...
      @Named
      @Admin
      public class MyBean implements Serializable

      { //... }

      //...
      @Stereotype
      @Secured(RoleAccessDecisionVoter.class)
      public @interface Admin
      {
      }

      @ApplicationScoped
      public class RoleAccessDecisionVoter implements AccessDecisionVoter
      {
      private static final long serialVersionUID = -8007511215776345835L;

      @Inject
      private AccessDecisionVoterContext voterContext;

      public Set<SecurityViolation> checkPermission(InvocationContext invocationContext)
      { Admin admin = voterContext.getMetaDataFor(Admin.class.getName(), Admin.class); //... }
      }

      #2:

      //...
      @Named
      @HasRole("admin")
      public class MyBean implements Serializable{ //... }

      //...
      @Stereotype
      @Secured(RoleAccessDecisionVoter.class)
      public @interface HasRole

      { String value(); }

      @ApplicationScoped
      public class RoleAccessDecisionVoter implements AccessDecisionVoter
      {
      private static final long serialVersionUID = -8007511215776345835L;

      @Inject
      private AccessDecisionVoterContext voterContext;

      public Set<SecurityViolation> checkPermission(InvocationContext invocationContext)

      { HasRole hasRole = voterContext.getMetaDataFor(HasRole.class.getName(), HasRole.class); String roleName = hasRole.value(); //... }

      }

        Activity

        Gerhard Petracek created issue -
        Gerhard Petracek made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        Gerhard Petracek made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Fix Version/s 1.0.4 [ 12319465 ]
        Resolution Fixed [ 1 ]
        Gerhard Petracek made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Gerhard Petracek made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Gerhard Petracek made changes -
        Description examples:

        #1:

        //...
        @Named
        @Admin
        public class MyBean implements Serializable
        {
          //...
        }

        //...
        @Stereotype
        @Secured(RoleAccessDecisionVoter.class)
        public @interface Admin
        {
        }

        @ApplicationScoped
        public class RoleAccessDecisionVoter implements AccessDecisionVoter
        {
            private static final long serialVersionUID = -8007511215776345835L;
            
            @Inject
            private AccessDecisionVoterContext voterContext;

            public Set<SecurityViolation> checkPermission(InvocationContext invocationContext)
            {
                Admin admin = voterContext.getMetaDataFor(Admin.class.getName(), Admin.class);
                //...
            }
        }

        #2:

        //...
        @Named
        @HasRole("admin")
        public class MyBean implements Serializable
        {
          //...
        }

        //...
        @Stereotype
        @Secured(TestAccessDecisionVoter.class)
        public @interface HasRole
        {
            String value();
        }


        @ApplicationScoped
        public class RoleAccessDecisionVoter implements AccessDecisionVoter
        {
            private static final long serialVersionUID = -8007511215776345835L;
            
            @Inject
            private AccessDecisionVoterContext voterContext;

            public Set<SecurityViolation> checkPermission(InvocationContext invocationContext)
            {
                HasRole hasRole = voterContext.getMetaDataFor(HasRole.class.getName(), HasRole.class);
                String roleName = hasRole.value();
                //...
            }
        }
        examples:

        #1:

        //...
        @Named
        @Admin
        public class MyBean implements Serializable
        {
          //...
        }

        //...
        @Stereotype
        @Secured(RoleAccessDecisionVoter.class)
        public @interface Admin
        {
        }

        @ApplicationScoped
        public class RoleAccessDecisionVoter implements AccessDecisionVoter
        {
            private static final long serialVersionUID = -8007511215776345835L;
            
            @Inject
            private AccessDecisionVoterContext voterContext;

            public Set<SecurityViolation> checkPermission(InvocationContext invocationContext)
            {
                Admin admin = voterContext.getMetaDataFor(Admin.class.getName(), Admin.class);
                //...
            }
        }

        #2:

        //...
        @Named
        @HasRole("admin")
        public class MyBean implements Serializable
        {
          //...
        }

        //...
        @Stereotype
        @Secured(RoleAccessDecisionVoter.class)
        public @interface HasRole
        {
            String value();
        }


        @ApplicationScoped
        public class RoleAccessDecisionVoter implements AccessDecisionVoter
        {
            private static final long serialVersionUID = -8007511215776345835L;
            
            @Inject
            private AccessDecisionVoterContext voterContext;

            public Set<SecurityViolation> checkPermission(InvocationContext invocationContext)
            {
                HasRole hasRole = voterContext.getMetaDataFor(HasRole.class.getName(), HasRole.class);
                String roleName = hasRole.value();
                //...
            }
        }
        Gerhard Petracek made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Gerhard Petracek
            Reporter:
            Gerhard Petracek
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development