Package org.beangle.security.blueprint

Examples of org.beangle.security.blueprint.User


public class MyUploadAction extends SecurityActionSupport {

  protected AvatarBase avatarBase;

  public String uploadForm() {
    User user = getUser();
    Avatar avatar = avatarBase.getAvatar(user.getName());
    put("avatar", avatar);
    put("user", user);
    return forward();
  }
View Full Code Here


    }
    return null;
  }

  public String info() {
    User user = getUser();
    Avatar avatar = avatarBase.getAvatar(user.getName());
    put("avatar", avatar);
    put("user", user);
    return forward();
  }
View Full Code Here

   */
  public String info() {
    String userName = get("user.name");
    if (StringUtils.isEmpty(userName)) { return null; }
    List<User> users = entityDao.get(User.class, "name", userName);
    User user = null;
    if (users.isEmpty()) {
      return null;
    } else {
      user = users.get(0);
    }

    Avatar avatar = avatarBase.getAvatar(user.getName());
    put("avatar", avatar);
    put("user", user);
    return forward();
  }
View Full Code Here

   */
  public String info() {
    String userName = get("user.name");
    if (StringUtils.isEmpty(userName)) { return null; }
    List<User> users = entityDao.get(User.class, "name", userName);
    User user = null;
    if (users.isEmpty()) {
      return null;
    } else {
      user = users.get(0);
    }
    Avatar avatar = avatarBase.getAvatar(user.getName());
    put("avatar", avatar);
    put("user", user);
    return forward();
  }
View Full Code Here

* @author chaostone
*/
public class HomeAction extends SecurityActionSupport {

  public String index() {
    User user = getUser();
    Long categoryId = getLong("security.categoryId");
    if (null == categoryId) {
      categoryId = getUserCategoryId();
    }
    put("menus", authorityService.getMenus(getMenuProfile(categoryId), user));
    put("user", user);
    put("categories", user.getCategories());
    return forward();
  }
View Full Code Here

  }

  private List<Restriction> getMyRestrictions(RestrictPattern pattern, RestrictionHolder holder) {
    String type = get("restrictionType");
    List<Restriction> restrictions = CollectUtils.newArrayList();
    User me = getUser();
    if (type.equals("user")) {
      restrictions = CollectUtils.newArrayList(((RestrictionHolder) me).getRestrictions());
    } else if (type.equals("group")) {
      for (GroupMember group : me.getGroups()) {
        restrictions.addAll(group.getGroup().getRestrictions());
      }
    } else if (type.equals("authority")) {
      restrictions = restrictionService.getAuthorityRestrictions(me,
          ((Authority) holder).getResource());
View Full Code Here

   * @throws Exception
   */
  public String updateUser() {
    Long userId = getLong("user.id");
    if (ValidEntityKeyPredicate.INSTANCE.evaluate(userId)) {
      User user = userService.get(userId);
      User manager = getUser();
      if (userService.isManagedBy(manager, user)) {
        return updateAccount(userId);
      } else {
        return null;
      }
View Full Code Here

  protected void editSetting(Entity<?> entity) {
    put("categories", entityDao.getAll(UserCategory.class));
  }

  protected OqlBuilder<Group> getQueryBuilder() {
    User manager = getUser();
    OqlBuilder<Group> entityQuery = OqlBuilder.from(entityName, "userGroup");
    if (!isAdmin(manager)) {
      entityQuery.join("userGroup.managers", "manager");
      entityQuery.where("manager.id=:managerId", manager.getId());
    }
    populateConditions(entityQuery);
    entityQuery.limit(getPageLimit()).orderBy(get("orderBy"));
    return entityQuery;
  }
View Full Code Here

  protected String saveAndForward(Entity<?> entity) {
    Group group = (Group) entity;
    if (entityDao.duplicate(Group.class, group.getId(), "name", group.getName())) { return redirect(
        "edit", "error.notUnique"); }
    if (!group.isPersisted()) {
      User creator = userService.get(getUserId());
      userService.createGroup(creator, group);
    } else {
      group.setUpdatedAt(new Date(System.currentTimeMillis()));
      if (!group.isPersisted()) {
        group.setCreatedAt(new Date(System.currentTimeMillis()));
View Full Code Here

   * @param response
   * @return
   */
  public String remove() {
    String groupIdSeq = get("groupIds");
    User curUser = userService.get(getUserId());
    List<Group> toBeRemoved = entityDao.get(Group.class, SeqStrUtils
        .transformToLong(groupIdSeq));
    userService.removeGroup(curUser, toBeRemoved);
    return redirect("search", "info.delete.success");
  }
View Full Code Here

TOP

Related Classes of org.beangle.security.blueprint.User

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.