Package org.togglz.core.user

Examples of org.togglz.core.user.SimpleFeatureUser


        assertFalse(strategy.isActive(state, aUserWithHash(99)));

    }

    private FeatureUser aUserWithHash(int hash) {
        return new SimpleFeatureUser("hash-" + hash, false);
    }
View Full Code Here


        this.userService = userService;
    }

    @Override
    public FeatureUser getCurrentUser() {
        SimpleFeatureUser featureUser = null;
        User user = userService.getCurrentUser();
        if (user != null) {
            featureUser = new SimpleFeatureUser(user.getUserId(), userService.isUserAdmin());
            featureUser.setAttribute("email", user.getEmail());
            featureUser.setAttribute("nickname", user.getNickname());
        }
        return featureUser;
    }
View Full Code Here

  @Override
  public UserProvider getUserProvider() {
    return new UserProvider() {
      @Override
      public FeatureUser getCurrentUser() {
        return new SimpleFeatureUser("admin", true);
      }
    };
  }
View Full Code Here

TOP

Related Classes of org.togglz.core.user.SimpleFeatureUser

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.