Package org.jboss.metadata.javaee.spec

Examples of org.jboss.metadata.javaee.spec.SecurityRolesMetaData


         // Security domain
         String securityDomain = earMetaData.getSecurityDomain();
         if(securityDomain != null && mergedMetaData.getSecurityDomain() == null)
            mergedMetaData.setSecurityDomain(securityDomain);
         //Security Roles
         SecurityRolesMetaData earSecurityRolesMetaData = earMetaData.getSecurityRoles();
         if(earSecurityRolesMetaData != null)
         {
            JBossAssemblyDescriptorMetaData jadmd = mergedMetaData.getAssemblyDescriptor();
            if( jadmd == null)
            {
               jadmd = new JBossAssemblyDescriptorMetaData();
               mergedMetaData.setAssemblyDescriptor(jadmd);
            }
           
            SecurityRolesMetaData mergedSecurityRolesMetaData = jadmd.getSecurityRoles();
            if(mergedSecurityRolesMetaData == null)
               jadmd.setSecurityRoles(earSecurityRolesMetaData);
           
            //perform a merge to rebuild the principalVersusRolesMap
            if(mergedSecurityRolesMetaData != null )
            {
                mergedSecurityRolesMetaData.merge(mergedSecurityRolesMetaData,
                     earSecurityRolesMetaData);
            }
        }
      }
View Full Code Here


            context.addConstraint(constraint);
         }
      }

      // Security roles
      SecurityRolesMetaData roles = metaData.getSecurityRoles();
      if (roles != null)
      {
         for (SecurityRoleMetaData value : roles)
         {
            context.addSecurityRole(value.getRoleName());
View Full Code Here

         // Security domain
         String securityDomain = earMetaData.getSecurityDomain();
         if(securityDomain != null && mergedMetaData.getSecurityDomain() == null)
            mergedMetaData.setSecurityDomain(securityDomain);
         //Security Roles
         SecurityRolesMetaData earSecurityRolesMetaData = earMetaData.getSecurityRoles();
         if(earSecurityRolesMetaData != null)
         {
            SecurityRolesMetaData mergedSecurityRolesMetaData = mergedMetaData.getSecurityRoles();
            if(mergedSecurityRolesMetaData == null)
               mergedMetaData.setSecurityRoles(earSecurityRolesMetaData);
           
            //perform a merge to rebuild the principalVersusRolesMap
            if(mergedSecurityRolesMetaData != null )
            {
                mergedSecurityRolesMetaData.merge(mergedSecurityRolesMetaData,
                     earSecurityRolesMetaData);
            }
        }
      }
View Full Code Here

    * @return security roles associated with EJB 21 deployment
    */
   public SecurityRolesMetaData getSecurityRoles(final Deployment dep)
   {
      final WebServiceDeployment wsDeployment = WSHelper.getRequiredAttachment(dep, WebServiceDeployment.class);
      final SecurityRolesMetaData securityRolesMD = new SecurityRolesMetaData();
      final Iterator<WebServiceDeclaration> ejbContainers = wsDeployment.getServiceEndpoints().iterator();

      while (ejbContainers.hasNext())
      {
         final WebServiceDeclaration ejbContainer = ejbContainers.next();
         final RolesAllowed allowedRoles = ejbContainer.getAnnotation(RolesAllowed.class);
         final boolean hasAllowedRoles = allowedRoles != null;

         if (hasAllowedRoles)
         {
            for (final String roleName : allowedRoles.value())
            {
               final SecurityRoleMetaData securityRoleMD = new SecurityRoleMetaData();

               securityRoleMD.setRoleName(roleName);
               securityRolesMD.add(securityRoleMD);
            }
         }
      }

      return securityRolesMD;
View Full Code Here

      final boolean hasAuthMethod = authMethod != null;

      if (hasAuthMethod)
      {
         final SecurityMetaDataAccessorEJB ejbMDAccessor = this.getEjbSecurityMetaDataAccessor(dep);
         final SecurityRolesMetaData securityRolesMD = ejbMDAccessor.getSecurityRoles(dep);
         final boolean hasSecurityRolesMD = securityRolesMD != null;

         if (hasSecurityRolesMD)
         {
            this.log.debug("Setting security roles: " + securityRolesMD);
View Full Code Here

      {
         assembly = new AssemblyDescriptorMetaData();
         ejbJarMetaData.setAssemblyDescriptor(assembly);
      }
      // @DeclareRoles
      SecurityRolesMetaData securityRoles = assembly.getSecurityRoles();
      if(securityRoles == null)
      {
         securityRoles = new SecurityRolesMetaData();
         assembly.setSecurityRoles(securityRoles);
      }
      super.processClass(securityRoles, beanClass);
      // @DenyAll
      ExcludeListMetaData excludes = assembly.getExcludeList();
View Full Code Here

     
      if(override != null && override.runAsIdentity!= null)
         setRunAsIdentity(override.runAsIdentity);

      if(securityRoles == null)
         securityRoles = new SecurityRolesMetaData();
      SecurityRolesMetaData overrideRoles = null;
      SecurityRolesMetaData originalRoles = null;
      if(override != null)
         overrideRoles = override.getSecurityRoles();
      if(original != null)
         originalRoles = original.getSecurityRoles();
      securityRoles.merge(overrideRoles, originalRoles);
View Full Code Here

         methodPermissions.merge(override != null ? override.methodPermissions : null, original != null ? original.methodPermissions : null);
      }
     
      if((override != null && override.securityRoles != null) || (original != null && original.securityRoles != null))
      {
         securityRoles = new SecurityRolesMetaData();
         securityRoles.merge(override != null ? override.securityRoles : null, original != null ? original.securityRoles : null);
      }
     
     
   }
View Full Code Here

         servlets = new ServletsMetaData();
         metaData.setServlets(servlets);
      }
      super.processClass(servlets, type);
      // @DeclareRoles
      SecurityRolesMetaData securityRoles = metaData.getSecurityRoles();
      if(securityRoles == null)
      {
         securityRoles = new SecurityRolesMetaData();
         metaData.setSecurityRoles(securityRoles);
      }
      super.processClass(securityRoles, type);
   }
View Full Code Here

      {
         assembly = new AssemblyDescriptorMetaData();
         ejbJarMetaData.setAssemblyDescriptor(assembly);
      }
      // @DeclareRoles
      SecurityRolesMetaData securityRoles = assembly.getSecurityRoles();
      if(securityRoles == null)
      {
         securityRoles = new SecurityRolesMetaData();
         assembly.setSecurityRoles(securityRoles);
      }
      super.processClass(securityRoles, beanClass);
      // @DenyAll
      ExcludeListMetaData excludes = assembly.getExcludeList();
View Full Code Here

TOP

Related Classes of org.jboss.metadata.javaee.spec.SecurityRolesMetaData

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.