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

        There are no comments yet on this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development