Package org.jboss.errai.security.shared.api.annotation

Examples of org.jboss.errai.security.shared.api.annotation.RestrictedAccess


    return null;
  }

  private RestrictedAccess getRestrictAccess(Method searchMethod, Method method) {
    RestrictedAccess requiredRoles = null;

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


  @Override
  public List<? extends Statement> generateDecorator(InjectableInstance<Page> ctx) {
    final List<Statement> stmts = new ArrayList<Statement>();

    if (ctx.getInjector().getInjectedType().isAnnotationPresent(RestrictedAccess.class)) {
      final RestrictedAccess annotation = ctx.getAnnotation(RestrictedAccess.class);
      final String roleListenerVar = ctx.getInjector().getInstanceVarName() + "_roleListener";
      ctx.getTargetInjector().addStatementToEndOfInjector(
              Stmt.declareFinalVariable(
                      roleListenerVar,
                      MetaClassFactory.parameterizedAs(LifecycleListener.class,
                              MetaClassFactory.typeParametersOf(ctx.getInjector().getInjectedType())),
                              Stmt.newObject(PageRoleLifecycleListener.class,
                                                      (Object) annotation.roles())));
      ctx.getTargetInjector().addStatementToEndOfInjector(
              Stmt.loadVariable("context")
                      .invoke("addInitializationCallback",
                              Refs.get(ctx.getInjector().getInstanceVarName()),
                              createInitializationCallback(
View Full Code Here

            && Arrays.equals(searchMethod.getParameterTypes(), method.getParameterTypes());
  }

  private void addRestrictedAccessIfPresent(final AnnotatedElement annotated,
          final Collection<RestrictedAccess> annotations) {
    final RestrictedAccess annotation = annotated.getAnnotation(RestrictedAccess.class);
    if (annotation != null) {
      annotations.add(annotation);
    }
  }
View Full Code Here

            && Arrays.equals(searchMethod.getParameterTypes(), method.getParameterTypes());
  }

  private void addRestrictedAccessIfPresent(final AnnotatedElement annotated,
          final Collection<RestrictedAccess> annotations) {
    final RestrictedAccess annotation = annotated.getAnnotation(RestrictedAccess.class);
    if (annotation != null) {
      annotations.add(annotation);
    }
  }
View Full Code Here

  @Override
  public List<? extends Statement> generateDecorator(InjectableInstance<Page> ctx) {
    final List<Statement> stmts = new ArrayList<Statement>();

    if (ctx.getInjector().getInjectedType().isAnnotationPresent(RestrictedAccess.class)) {
      final RestrictedAccess annotation = ctx.getAnnotation(RestrictedAccess.class);
      final String roleListenerVar = ctx.getInjector().getInstanceVarName() + "_roleListener";
      ctx.getTargetInjector().addStatementToEndOfInjector(
              Stmt.declareFinalVariable(
                      roleListenerVar,
                      MetaClassFactory.parameterizedAs(LifecycleListener.class,
                              MetaClassFactory.typeParametersOf(ctx.getInjector().getInjectedType())),
                              Stmt.newObject(PageRoleLifecycleListener.class,
                                                      (Object[]) annotation.roles())));
      ctx.getTargetInjector().addStatementToEndOfInjector(
              Stmt.loadVariable("context")
                      .invoke("addInitializationCallback",
                              Refs.get(ctx.getInjector().getInstanceVarName()),
                              createInitializationCallback(
View Full Code Here

TOP

Related Classes of org.jboss.errai.security.shared.api.annotation.RestrictedAccess

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.