Examples of MethodPermissionMetaData


Examples of org.jboss.metadata.ejb.spec.MethodPermissionMetaData

      MethodPermissionsMetaData permissions = md.getAssemblyDescriptor().getMethodPermissions()
            .getMethodPermissionsByEjbName(implClass.getSimpleName());
      TestCase.assertEquals(
            "Only one set of " + MethodPermissionsMetaData.class.getSimpleName() + " should be defined", 1, permissions
                  .size());
      MethodPermissionMetaData permission = permissions.get(0);
      TestCase.assertNotNull(permission);

      // Ensure we've got the right method associated w/ the permission
      MethodsMetaData methods = permission.getMethods();
      TestCase.assertEquals(1, methods.size());
      MethodMetaData method = methods.get(0);
      TestCase.assertNotNull(method);
      String methodName = method.getMethodName();
      String expectedMethodName = "someMethod";
      TestCase.assertEquals(expectedMethodName, methodName);

      // Ensure we've got the right role associated w/ the permission
      Set<String> roles = permission.getRoles();
      TestCase.assertEquals("Only one role was expected", 1, roles.size());
      String role = roles.iterator().next();
      TestCase.assertEquals(SecureService.ROLES_EJB, role);

   }
View Full Code Here

Examples of org.jboss.metadata.ejb.spec.MethodPermissionMetaData

               }
            }
         }
      }
     
      MethodPermissionMetaData perm = new MethodPermissionMetaData();
      MethodsMetaData methods = perm.getMethods();
      if(methods == null)
      {
         methods = new MethodsMetaData();
         perm.setMethods(methods);
      }
      HashSet<String> roles = new HashSet<String>();
      for(String role : allowed.value())
         roles.add(role);
      perm.setRoles(roles);
      Descriptions descriptions = ProcessorUtils.getDescription("@RolesAllowed for: "+type);
      mmd.setDescriptions(descriptions);
      methods.add(mmd);
      metaData.add(perm);
   }
View Full Code Here

Examples of org.jboss.metadata.ejb.spec.MethodPermissionMetaData

      if(type instanceof Method)
         method = (Method) type;

      String ejbName = EjbNameThreadLocal.ejbName.get();
      MethodMetaData mmd = ProcessorUtils.createMethod(ejbName, method);
      MethodPermissionMetaData perm = new MethodPermissionMetaData();
      MethodsMetaData methods = perm.getMethods();
      if(methods == null)
      {
         methods = new MethodsMetaData();
         perm.setMethods(methods);
      }
      perm.setUnchecked(new EmptyMetaData());
      Descriptions descriptions = ProcessorUtils.getDescription("@PermitAll for: "+type);
      mmd.setDescriptions(descriptions);
      methods.add(mmd);
      metaData.add(perm);
   }
View Full Code Here

Examples of org.jboss.metadata.ejb.spec.MethodPermissionMetaData

/* 63 */     if ((type instanceof Method)) {
/* 64 */       method = (Method)type;
/*    */     }
/* 66 */     String ejbName = (String)EjbNameThreadLocal.ejbName.get();
/* 67 */     MethodMetaData mmd = ProcessorUtils.createMethod(ejbName, method);
/* 68 */     MethodPermissionMetaData perm = new MethodPermissionMetaData();
/* 69 */     MethodsMetaData methods = perm.getMethods();
/* 70 */     if (methods == null)
/*    */     {
/* 72 */       methods = new MethodsMetaData();
/* 73 */       perm.setMethods(methods);
/*    */     }
/* 75 */     perm.setUnchecked(new EmptyMetaData());
/* 76 */     Descriptions descriptions = ProcessorUtils.getDescription("@PermitAll for: " + type);
/* 77 */     mmd.setDescriptions(descriptions);
/* 78 */     methods.add(mmd);
/* 79 */     metaData.add(perm);
/*    */   }
View Full Code Here

Examples of org.jboss.metadata.ejb.spec.MethodPermissionMetaData

/* 64 */     if ((type instanceof Method)) {
/* 65 */       method = (Method)type;
/*    */     }
/* 67 */     String ejbName = (String)EjbNameThreadLocal.ejbName.get();
/* 68 */     MethodMetaData mmd = ProcessorUtils.createMethod(ejbName, method);
/* 69 */     MethodPermissionMetaData perm = new MethodPermissionMetaData();
/* 70 */     MethodsMetaData methods = perm.getMethods();
/* 71 */     if (methods == null)
/*    */     {
/* 73 */       methods = new MethodsMetaData();
/* 74 */       perm.setMethods(methods);
/*    */     }
/* 76 */     HashSet roles = new HashSet();
/* 77 */     for (String role : allowed.value())
/* 78 */       roles.add(role);
/* 79 */     perm.setRoles(roles);
/* 80 */     Descriptions descriptions = ProcessorUtils.getDescription("@RolesAllowed for: " + type);
/* 81 */     mmd.setDescriptions(descriptions);
/* 82 */     methods.add(mmd);
/* 83 */     metaData.add(perm);
/*    */   }
View Full Code Here

Examples of org.jboss.metadata.ejb.spec.MethodPermissionMetaData

/*  92 */                 pc.addToRole(role, p);
/*     */               }
/*     */             }
/*     */           }
/*     */       }
/*     */     MethodPermissionMetaData perm;
/*  99 */     ExcludeListMetaData excluded = bean.getExcludeList();
/* 100 */     if (excluded != null)
/*     */     {
/* 102 */       MethodsMetaData methods = excluded.getMethods();
/* 103 */       if (methods != null) {
View Full Code Here

Examples of org.jboss.metadata.ejb.spec.MethodPermissionMetaData

/*      */             }
/*      */           }
/*      */         }
/*      */       }
/*      */     }
/*      */     MethodPermissionMetaData permission;
/* 1100 */     if ((enterpriseBean != null) && (enterpriseBean.getSecurityDomain() != null))
/*      */     {
/* 1102 */       String securityDomain = enterpriseBean.getSecurityDomain();
/*      */
/* 1104 */       SecurityDomainImpl annotation = new SecurityDomainImpl(securityDomain);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.