Package org.jboss.seam.annotations.security

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


               break;
            case DELETE:
               m = e.getPreRemoveMethod();
         }
        
         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

   public Object aroundInvoke(InvocationContext invocation) throws Exception
   {
      Method interfaceMethod = invocation.getMethod();
      //TODO: optimize this:
      Method method = getComponent().getBeanClass().getMethod( interfaceMethod.getName(), interfaceMethod.getParameterTypes() );
      Restrict restrict = getRestriction(method);
      if (restrict != null)
      {
         String expr = !Strings.isEmpty( restrict.value() ) ?
                  restrict.value() : createDefaultExpr(method);
         Identity.instance().checkRestriction(expr);
      }
      return invocation.proceed();
   }
View Full Code Here

  
         identity.isLoggedIn(true);
        
         Class beanClass = PersistenceProvider.instance().getBeanClass(entity);
        
         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()))
            {
               String name = Seam.getComponentName(beanClass);
               if (name == null)
               {
                  name = beanClass.getName();
               }
               Identity.instance().checkPermission(name, action.toString(), entity);
            }
            else
            {
               Identity.instance().checkRestriction(restrict.value());
            }
         }
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.seam.annotations.security.Restrict

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.