Examples of Restrict


Examples of org.apache.tools.ant.types.resources.Restrict

            if (checkDestNotInSources.size() > 0) {
                throw new BuildException("Destination resource " + dest
                        + " was specified as an input resource.");
            }
        }
        Restrict noexistRc = new Restrict();
        noexistRc.add(NOT_EXISTS);
        noexistRc.add(rc);
        for (Iterator i = noexistRc.iterator(); i.hasNext();) {
            log(i.next() + " does not exist.", Project.MSG_ERR);
        }
        Restrict result = new Restrict();
        result.add(EXISTS);
        result.add(rc);
        return result;
    }
View Full Code Here

Examples of org.jboss.seam.annotations.security.Restrict

               Restriction restriction = null;
              
               Method method = getComponent().getBeanClass().getMethod(
                     interfaceMethod.getName(), interfaceMethod.getParameterTypes() );     
              
               Restrict restrict = null;
              
               if ( method.isAnnotationPresent(Restrict.class) )
               {
                  restrict = method.getAnnotation(Restrict.class);
               }
               else if ( getComponent().getBeanClass().isAnnotationPresent(Restrict.class) )
               {
                  if ( !getComponent().isLifecycleMethod(method) )
                  {
                     restrict = getComponent().getBeanClass().getAnnotation(Restrict.class);
                  }
               }
              
               if (restrict != null)
               {
                  if (restriction == null) restriction = new Restriction();
                 
                  if ( Strings.isEmpty(restrict.value()) )
                  {
                     restriction.setPermissionTarget(getComponent().getName());
                     restriction.setPermissionAction(method.getName());
                  }
                  else
                  {
                     restriction.setExpression(restrict.value());
                  }
               }
              
               for (Annotation annotation : method.getDeclaringClass().getAnnotations())
               {
View Full Code Here

Examples of org.jboss.seam.annotations.security.Restrict

               Restriction restriction = null;
              
               Method method = getComponent().getBeanClass().getMethod(
                     interfaceMethod.getName(), interfaceMethod.getParameterTypes() );     
              
               Restrict restrict = null;
              
               if ( method.isAnnotationPresent(Restrict.class) )
               {
                  restrict = method.getAnnotation(Restrict.class);
               }
               else if ( getComponent().getBeanClass().isAnnotationPresent(Restrict.class) )
               {
                  if ( !getComponent().isLifecycleMethod(method) )
                  {
                     restrict = getComponent().getBeanClass().getAnnotation(Restrict.class);
                  }
               }
              
               if (restrict != null)
               {
                  if (restriction == null) restriction = new Restriction();
                 
                  if ( Strings.isEmpty(restrict.value()) )
                  {
                     restriction.setPermissionTarget(getComponent().getName());
                     restriction.setPermissionAction(method.getName());
                  }
                  else
                  {
                     restriction.setExpression(restrict.value());
                  }
               }
              
               for (Annotation annotation : method.getDeclaringClass().getAnnotations())
               {
View Full Code Here

Examples of org.jboss.seam.annotations.security.Restrict

               break;
            case DELETE:
               m = provider.getPreRemoveMethod(entity, getEntityManager());
         }
        
         Restrict restrict = null;
        
         if (m != null && m.isAnnotationPresent(Restrict.class))
         {
            restrict = m.getAnnotation(Restrict.class);
         }
         else if (entity.getClass().isAnnotationPresent(Restrict.class))
         {
            restrict = entity.getClass().getAnnotation(Restrict.class);
         }

         if (restrict != null)
         {
            if (Strings.isEmpty(restrict.value()))
            {
               identity.checkPermission(entity, action.toString());
            }
            else
            {
               identity.checkRestriction(restrict.value());
            }
         }
      }
   } 
View Full Code Here

Examples of org.jboss.seam.annotations.security.Restrict

      {
         for (Annotation annotation : cls.getAnnotations())
         {
            if (annotation instanceof Restrict)
            {
               Restrict restrict = (Restrict) annotation;
               if (restrictions == null) restrictions = new HashSet<String>();
              
               if ( Strings.isEmpty(restrict.value()) )
               {
                  throw new IllegalStateException("@Restrict on " + cls.getName() + " must specify an expression");
               }
              
               restrictions.add(restrict.value());
            }
           
            if (annotation.annotationType().isAnnotationPresent(RoleCheck.class))
            {
               if (restrictions == null) restrictions = new HashSet<String>();
View Full Code Here

Examples of org.jboss.seam.annotations.security.Restrict

               Restriction restriction = null;
              
               Method method = getComponent().getBeanClass().getMethod(
                     interfaceMethod.getName(), interfaceMethod.getParameterTypes() );     
              
               Restrict restrict = null;
              
               if ( method.isAnnotationPresent(Restrict.class) )
               {
                  restrict = method.getAnnotation(Restrict.class);
               }
               else if ( getComponent().getBeanClass().isAnnotationPresent(Restrict.class) )
               {
                  if ( !getComponent().isLifecycleMethod(method) )
                  {
                     restrict = getComponent().getBeanClass().getAnnotation(Restrict.class);
                  }
               }
              
               if (restrict != null)
               {
                  if (restriction == null) restriction = new Restriction();
                 
                  if ( Strings.isEmpty(restrict.value()) )
                  {
                     restriction.setPermissionTarget(getComponent().getName());
                     restriction.setPermissionAction(method.getName());
                  }
                  else
                  {
                     restriction.setExpression(restrict.value());
                  }
               }
              
               for (Annotation annotation : method.getDeclaringClass().getAnnotations())
               {
View Full Code Here

Examples of org.jboss.seam.annotations.security.Restrict

               Restriction restriction = null;
              
               Method method = getComponent().getBeanClass().getMethod(
                     interfaceMethod.getName(), interfaceMethod.getParameterTypes() );     
              
               Restrict restrict = null;
              
               if ( method.isAnnotationPresent(Restrict.class) )
               {
                  restrict = method.getAnnotation(Restrict.class);
               }
               else if ( getComponent().getBeanClass().isAnnotationPresent(Restrict.class) )
               {
                  if ( !getComponent().isLifecycleMethod(method) )
                  {
                     restrict = getComponent().getBeanClass().getAnnotation(Restrict.class);
                  }
               }
              
               if (restrict != null)
               {
                  if (restriction == null) restriction = new Restriction();
                 
                  if ( Strings.isEmpty(restrict.value()) )
                  {
                     restriction.setPermissionTarget(getComponent().getName());
                     restriction.setPermissionAction(method.getName());
                  }
                  else
                  {
                     restriction.setExpression(restrict.value());
                  }
               }
              
               for (Annotation annotation : method.getDeclaringClass().getAnnotations())
               {
View Full Code Here

Examples of org.jboss.seam.annotations.security.Restrict

               break;
            case DELETE:
               m = provider.getPreRemoveMethod(entity, getEntityManager());
         }
        
         Restrict restrict = null;
        
         if (m != null && m.isAnnotationPresent(Restrict.class))
         {
            restrict = m.getAnnotation(Restrict.class);
         }
         else if (entity.getClass().isAnnotationPresent(Restrict.class))
         {
            restrict = entity.getClass().getAnnotation(Restrict.class);
         }

         if (restrict != null)
         {
            if (Strings.isEmpty(restrict.value()))
            {
               identity.checkPermission(entity, action.toString());
            }
            else
            {
               identity.checkRestriction(restrict.value());
            }
         }
      }
   } 
View Full Code Here

Examples of org.jboss.seam.annotations.security.Restrict

               break;
            case DELETE:
               m = provider.getPreRemoveMethod(beanClass);
         }
        
         Restrict restrict = null;
        
         if (m != null && m.isAnnotationPresent(Restrict.class))
         {
            restrict = m.getAnnotation(Restrict.class);
         }
         else if (entity.getClass().isAnnotationPresent(Restrict.class))
         {
            restrict = entity.getClass().getAnnotation(Restrict.class);
         }

         if (restrict != null)
         {
            if (Strings.isEmpty(restrict.value()))
            {
               checkPermission(name, action.toString(), entity);
            }
            else
            {
               checkRestriction(restrict.value());
            }
         }
      }
   }  
View Full Code Here

Examples of org.jboss.seam.annotations.security.Restrict

   {
      Method interfaceMethod = invocation.getMethod();
      //TODO: optimize this:
      Method method = getComponent().getBeanClass()
               .getMethod( interfaceMethod.getName(), interfaceMethod.getParameterTypes() );
      Restrict restrict = getRestriction(method);
     
      if ( restrict!=null && Identity.isSecurityEnabled() )
      {
         String expr = !Strings.isEmpty( restrict.value() ) ?
                  restrict.value() : createDefaultExpr(method);
         Identity.instance().checkRestriction(expr);
      }
      return invocation.proceed();
   }
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.