Package javax.annotation.security

Examples of javax.annotation.security.PermitAll


            policySet.getPolicies().add(policy);
            policySet.setUnresolved(false);
            confOp.getPolicySets().add(policySet);
        }
       
        PermitAll permitAll = method.getAnnotation(javax.annotation.security.PermitAll.class);
        if(permitAll != null) {
            AuthorizationPolicy policy = new AuthorizationPolicy();
            policy.setAccessControl(AuthorizationPolicy.AcessControl.permitAll);
           
            ConfiguredOperation confOp = assemblyFactory.createConfiguredOperation();
View Full Code Here


                 * Process annotations at the class level
                 */
                if (!classPermissions.contains("*") || !classPermissions.contains(clazz.getName())) {

                    RolesAllowed rolesAllowed = clazz.getAnnotation(RolesAllowed.class);
                    PermitAll permitAll = clazz.getAnnotation(PermitAll.class);

                    /*
                     * @RolesAllowed
                     */
                    if (rolesAllowed != null && permitAll != null) {
View Full Code Here

            PolicySet policySet = createPolicySet(ALLOW, AuthorizationPolicy.NAME, policy);
            type.getPolicySets().add(policySet);
        }
       
        PermitAll permitAll = clazz.getAnnotation(javax.annotation.security.PermitAll.class);
        if(permitAll != null) {
            AuthorizationPolicy policy = new AuthorizationPolicy();
            policy.setAccessControl(AuthorizationPolicy.AcessControl.permitAll);
            PolicySet policySet = createPolicySet(PERMIT_ALL, AuthorizationPolicy.NAME, policy);
            type.getPolicySets().add(policySet);
View Full Code Here

                PolicySet policySet = createPolicySet(ALLOW, AuthorizationPolicy.NAME, policy);
                operation.getPolicySets().add(policySet);
            }
        }
       
        PermitAll permitAll = method.getAnnotation(javax.annotation.security.PermitAll.class);
        if(permitAll != null) {
            AuthorizationPolicy policy = new AuthorizationPolicy();
            policy.setAccessControl(AuthorizationPolicy.AcessControl.permitAll);
           
            // find the operation in the interface model
View Full Code Here

            policySet.getPolicies().add(policy);
            policySet.setUnresolved(false);
            ((org.apache.tuscany.sca.policy.PolicySetAttachPoint)type).getPolicySets().add(policySet);
        }
       
        PermitAll permitAll = clazz.getAnnotation(javax.annotation.security.PermitAll.class);
        if(permitAll != null) {
            AuthorizationPolicy policy = new AuthorizationPolicy();
            policy.setAccessControl(AuthorizationPolicy.AcessControl.permitAll);
           
            PolicySet policySet = policyFactory.createPolicySet();
View Full Code Here

            policySet.getPolicies().add(policy);
            policySet.setUnresolved(false);
            confOp.getPolicySets().add(policySet);
        }
       
        PermitAll permitAll = method.getAnnotation(javax.annotation.security.PermitAll.class);
        if(permitAll != null) {
            AuthorizationPolicy policy = new AuthorizationPolicy();
            policy.setAccessControl(AuthorizationPolicy.AcessControl.permitAll);
           
            ConfiguredOperation confOp = assemblyFactory.createConfiguredOperation();
View Full Code Here

                 * Process annotations at the class level
                 */
                if (!classPermissions.contains("*") || !classPermissions.contains(clazz.getName())) {

                    final RolesAllowed rolesAllowed = clazz.getAnnotation(RolesAllowed.class);
                    final PermitAll permitAll = clazz.getAnnotation(PermitAll.class);
                    final DenyAll denyAll = clazz.getAnnotation(DenyAll.class);

                    /*
                     * @RolesAllowed
                     */
 
View Full Code Here

                    methodPermission.getRoleName().addAll(Arrays.asList(rolesAllowed.value()));
                    methodPermission.getMethod().add(new org.apache.openejb.jee.Method(ejbName, method));
                    assemblyDescriptor.getMethodPermission().add(methodPermission);
                }

                PermitAll permitAll = clazz.getAnnotation(PermitAll.class);
                if (permitAll != null) {
                    MethodPermission methodPermission = new MethodPermission();
                    methodPermission.setUnchecked(true);
                    methodPermission.getMethod().add(new org.apache.openejb.jee.Method(ejbName, "*"));
                    assemblyDescriptor.getMethodPermission().add(methodPermission);
View Full Code Here

                 * Process annotations at the class level
                 */
                if (!classPermissions.contains("*") || !classPermissions.contains(clazz.getName())) {

                    final RolesAllowed rolesAllowed = clazz.getAnnotation(RolesAllowed.class);
                    final PermitAll permitAll = clazz.getAnnotation(PermitAll.class);
                    final DenyAll denyAll = clazz.getAnnotation(DenyAll.class);

                    /*
                     * @RolesAllowed
                     */
 
View Full Code Here

   private static void addPermissions(EJBContainer container, PolicyConfiguration pc)
   {
      SecurityDomain sd = (SecurityDomain) container.resolveAnnotation(SecurityDomain.class);

      PermitAll beanUnchecked = (PermitAll) container.resolveAnnotation(PermitAll.class);
      RolesAllowed beanPermissions = (RolesAllowed) container.resolveAnnotation(RolesAllowed.class);
     
      DeclareRoles beanDeclareRolesPerms = (DeclareRoles)container.resolveAnnotation(DeclareRoles.class);

      if (beanUnchecked != null && beanPermissions != null)
      {
         throw new RuntimeException("Cannot annotate a bean with both @Unchecked and @MethodPermissions");
      }

      String ejbName = container.getEjbName();

      //Add the security role references
      if(beanDeclareRolesPerms != null)
      {
         String[] rolerefs = beanDeclareRolesPerms.value();
         int len = rolerefs != null ? rolerefs.length : 0;
         for(int i=0; i < len; i++)
         {
             try
            {
               pc.addToRole(rolerefs[i], new EJBRoleRefPermission(ejbName, rolerefs[i]));
            }
            catch (PolicyContextException e)
            {
               throw new RuntimeException(e);
            }
         }
      }
     
      //Am I iterating over the right thing here? Should I be using the stuff from
      //Advisor.methodInterceptors instead?
      for(Method m : container.getBeanClass().getMethods())
      {
         EJBMethodPermission permission = new EJBMethodPermission(ejbName, null, m);
         log.trace("Creating permission: " + permission);

         PermitAll unchecked = (PermitAll) container.resolveAnnotation(m, PermitAll.class);
         RolesAllowed permissions = (RolesAllowed) container.resolveAnnotation(m, RolesAllowed.class);
         DenyAll exclude = (DenyAll) container.resolveAnnotation(m, DenyAll.class);

         int annotationCount = getAnnotationCount(unchecked, permissions, exclude);
View Full Code Here

TOP

Related Classes of javax.annotation.security.PermitAll

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.