Package org.jboss.errai.security.client.local.api

Examples of org.jboss.errai.security.client.local.api.SecurityContext


  }

  @Override
  public void observeEvent(final LifecycleEvent<W> event) {
    // There is no good way to inject the context within the bootstrapper.
    final SecurityContext securityContext = SecurityContextHoldingSingleton.getSecurityContext();
    final Set<Role> roles = roleExtractor.extractAllRoles(annotation);
   
    if (!securityContext.isUserCacheValid() || !securityContext.hasCachedUser()
            || !securityContext.getCachedUser().getRoles().containsAll(roles)) {
      event.veto();

      if (!securityContext.hasCachedUser())
        securityContext.redirectToLoginPage(event.getInstance().getClass());
      else
        securityContext.redirectToSecurityErrorPage(event.getInstance().getClass());
    }
  }
View Full Code Here


  }

  @Override
  public void observeEvent(final LifecycleEvent<W> event) {
    // There is no good way to inject the context within the bootstrapper.
    final SecurityContext securityContext = SecurityContextHoldingSingleton.getSecurityContext();
    final Set<Role> roles = roleExtractor.extractAllRoles(annotation);

    if (!securityContext.isUserCacheValid() || !securityContext.hasCachedUser()
            || !securityContext.getCachedUser().getRoles().containsAll(roles)) {
      event.veto();

      if (!securityContext.hasCachedUser())
        securityContext.redirectToLoginPage(event.getInstance().getClass());
      else
        securityContext.redirectToSecurityErrorPage(event.getInstance().getClass());
    }
  }
View Full Code Here

  }

  @Override
  public void observeEvent(final LifecycleEvent<W> event) {
    // There is no good way to inject the context within the bootstrapper.
    final SecurityContext securityContext = SecurityContextHoldingSingleton.getSecurityContext();

    if (!securityContext.isUserCacheValid() || !securityContext.hasCachedUser()
            || !securityContext.getCachedUser().hasAllRoles(roles)) {
      event.veto();

      if (!securityContext.hasCachedUser())
        securityContext.redirectToLoginPage(event.getInstance().getClass());
      else
        securityContext.redirectToSecurityErrorPage(event.getInstance().getClass());
    }
  }
View Full Code Here

  }

  @Override
  public void observeEvent(final LifecycleEvent<W> event) {
    // There is no good way to inject the context within the bootstrapper.
    final SecurityContext securityContext = SecurityContextHoldingSingleton.getSecurityContext();

    if (!securityContext.isUserCacheValid() || !securityContext.hasCachedUser()
            || !securityContext.getCachedUser().hasAllRoles(roles)) {
      event.veto();

      final Class<? extends UniquePageRole> destination;
      if (!securityContext.hasCachedUser())
        destination = LoginPage.class;
      else
        destination = SecurityError.class;

      securityContext.navigateToPage(destination);
    }
  }
View Full Code Here

TOP

Related Classes of org.jboss.errai.security.client.local.api.SecurityContext

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.