Package org.geomajas.security

Examples of org.geomajas.security.SavedAuthorization


   * Puts the cached security context in the thread local.
   *
   * @param context the cache context
   */
  public void restoreSecurityContext(CacheContext context) {
    SavedAuthorization cached = context.get(CacheContext.SECURITY_CONTEXT_KEY, SavedAuthorization.class);
    if (cached != null) {
      log.debug("Restoring security context {}", cached);
      securityManager.restoreSecurityContext(cached);
    } else {
      securityManager.clearSecurityContext();
View Full Code Here


   * @param context cache context
   */
  public void addMoreContext(CacheContext context) {
    Object cached = context.get(CacheContext.SECURITY_CONTEXT_KEY);
    if (cached == null) {
      SavedAuthorization sa = securityContext.getSavedAuthorization();
      log.debug("Storing SavedAuthorization {}", sa);
      context.put(CacheContext.SECURITY_CONTEXT_KEY, sa);
    }
  }
View Full Code Here

    Assert.assertEquals(USER_ID,context.getUserId());
    Assert.assertEquals(USER_NAME,context.getUserName());
    Assert.assertEquals(USER_LOCALE,context.getUserLocale());
    Assert.assertEquals(USER_ORGANIZATION,context.getUserOrganization());
    Assert.assertEquals(USER_DIVISION,context.getUserDivision());
    SavedAuthorization sa = context.getSavedAuthorization();
    Assert.assertNotNull(sa);
    securityManager.restoreSecurityContext(sa);
    Assert.assertEquals(context.getId(), securityContext.getId());
    Assert.assertEquals(null, securityContext.getUserId());
    Assert.assertEquals(null, securityContext.getUserName());
View Full Code Here

    testRecorder.clear();
    securityManager.createSecurityContext(TOKEN);
    Assert.assertEquals("", testRecorder.matches(AllowNoneWiredAuthorization.GROUP,
        AllowNoneWiredAuthorization.VALUE));

    SavedAuthorization saved = securityContext.getSavedAuthorization();
    securityManager.clearSecurityContext();
    testRecorder.clear();
    securityManager.restoreSecurityContext(saved);
    Assert.assertEquals("", testRecorder.matches(AllowNoneWiredAuthorization.GROUP,
        AllowNoneWiredAuthorization.VALUE));
View Full Code Here

TOP

Related Classes of org.geomajas.security.SavedAuthorization

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.