Package org.jboss.errai.security.shared

Examples of org.jboss.errai.security.shared.RequireRoles


  }

  @AroundInvoke
  public Object aroundInvoke(InvocationContext context) throws Exception {
    final List<Role> roles = authenticationService.getRoles();
    final RequireRoles annotation = getRequiredRoleAnnotation(context.getTarget().getClass(), context.getMethod());
    if (hasAllRoles(roles, annotation.value())) {
      return context.proceed();
    } else {
      throw new SecurityException("unauthorised access");
    }
  }
View Full Code Here


      throw new SecurityException("unauthorised access");
    }
  }

  private RequireRoles getRequiredRoleAnnotation(Class<?> aClass, Method method) {
    RequireRoles requireRoles = getRequiredRoleAnnotation(method.getAnnotations());
    if (requireRoles != null) {
      return requireRoles;
    }

    Class<?>[] interfaces = aClass.getInterfaces();
View Full Code Here

    return requireRoles;
  }

  private RequireRoles getRequireRoles(Class<?> aClass, Method searchMethod) {
    for (Method method : aClass.getMethods()) {
      final RequireRoles requireRoles = getRequireRoles(searchMethod, method);
      if (requireRoles != null) {
        return requireRoles;
      }
    }
View Full Code Here

    return null;
  }

  private RequireRoles getRequireRoles(Method searchMethod, Method method) {
    RequireRoles requiredRoles = null;

    if (searchMethod.getName().equals(method.getName())
            && Arrays.equals(searchMethod.getParameterTypes(), method.getParameterTypes())) {
      requiredRoles = getRequiredRoleAnnotation(method.getAnnotations());
    }
View Full Code Here

TOP

Related Classes of org.jboss.errai.security.shared.RequireRoles

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.