Package javax.annotation.security

Examples of javax.annotation.security.RunAs


        // Process RunAs
        if (wcd.getRunAsIdentity() == null) {
            String roleName = runAsRoleName;
            if (roleName == null && clazz.isAnnotationPresent(RunAs.class)) {
                RunAs runAs = (RunAs)clazz.getAnnotation(RunAs.class);
                roleName = runAs.value();
            }
            if (roleName != null) {
                super.setRunAsRole(roleName);

                wbd.addRole(new Role(roleName));
View Full Code Here


                }

                /*
                 * @RunAs
                 */
                RunAs runAs = clazz.getAnnotation(RunAs.class);
                if (runAs != null && bean.getSecurityIdentity() == null) {
                    SecurityIdentity securityIdentity = new SecurityIdentity();
                    securityIdentity.setRunAs(runAs.value());
                    bean.setSecurityIdentity(securityIdentity);
                }

                /*
                 * @DeclareRoles
 
View Full Code Here

   @SuppressWarnings("unused")
   private static final Logger log = Logger.getLogger(RunAsSecurityInterceptorFactory.class);
 
   protected RunAsIdentity getRunAsIdentity(EJBContainer container)
   {     
      RunAs runAs = (RunAs) container.getAnnotation(RunAs.class);
      if (runAs == null)
         return null;
     
      String runAsPrincipal = runAs.value();
      Set<String> extraRoles = new HashSet<String>();
     
      JBossEnterpriseBeanMetaData jbEnterpriseBeanMetaData = container.getXml();
      if(jbEnterpriseBeanMetaData != null)
      {
         SecurityIdentityMetaData securityIdentity = jbEnterpriseBeanMetaData.getSecurityIdentity();
         if(securityIdentity.isUseCallerId())
            return null; //Overriden in xml
         runAsPrincipal = securityIdentity.getRunAsPrincipal()
         Map<String,Set<String>> principalVsRoleMap =
           jbEnterpriseBeanMetaData.getSecurityRolesPrincipalVersusRolesMap();
         extraRoles = principalVsRoleMap.get(runAsPrincipal)
      }
      
      JBossAssemblyDescriptorMetaData ad = container.getAssemblyDescriptor();
      if(ad != null && runAsPrincipal != null)
      {
         extraRoles.addAll(ad.getSecurityRoleNamesByPrincipal(runAsPrincipal));
      }
     
      return new RunAsIdentity(runAs.value(), runAsPrincipal, extraRoles);

   }
View Full Code Here

   */
  @Override
  public AspectGenerator<X> create(AnnotatedMethod<? super X> method,
                                   boolean isEnhanced)
  {
    RunAs runAs = method.getAnnotation(RunAs.class);
     
    if (runAs == null)
      runAs = _classRunAs;
   
    String runAsName = null;
     
    if (runAs != null)
      runAsName = runAs.value();
     
    RolesAllowed rolesAllowed = method.getAnnotation(RolesAllowed.class);
   
    if (rolesAllowed == null)
      rolesAllowed = _classRolesAllowed;
View Full Code Here

                /* Process RunAs annotation which can be only on servlets.
                 * Ref JSR 250, equivalent to the run-as element in
                 * the deployment descriptor
                 */
                if (classClass.isAnnotationPresent(RunAs.class)) {
                    RunAs annotation = (RunAs)
                        classClass.getAnnotation(RunAs.class);
                    wrapper.setRunAs(annotation.value());
                }
            }
        }
       
       
View Full Code Here

        // Process RunAs
        if (wcd.getRunAsIdentity() == null) {
            String roleName = runAsRoleName;
            if (roleName == null && clazz.isAnnotationPresent(RunAs.class)) {
                RunAs runAs = (RunAs)clazz.getAnnotation(RunAs.class);
                roleName = runAs.value();
            }
            if (roleName != null) {
                super.setRunAsRole(roleName);

                wbd.addRole(new Role(roleName));
View Full Code Here

TOP

Related Classes of javax.annotation.security.RunAs

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.