Package org.beangle.security.blueprint

Examples of org.beangle.security.blueprint.Authority


    }
    String forEdit = Params.get("forEdit");
    if (StringUtils.isNotEmpty(forEdit)) {
      List<RestrictObject> restrictObjects = CollectUtils.newArrayList();
      if (holder instanceof Authority) {
        Authority au = (Authority) holder;
        restrictObjects.addAll(au.getResource().getObjects());
      } else {
        restrictObjects = entityDao.getAll(RestrictObject.class);
      }
      ContextHelper.put("restrictObjects", restrictObjects);
    }
View Full Code Here


    // authority.setMenu(menu);
    // mao.getMenuAuthorities().add(authority);
    // }

    for (Resource resource : newResources) {
      Authority authority = Model.newInstance(Authority.class);
      authority.setGroup(mao);
      authority.setResource(resource);
      mao.getAuthorities().add(authority);
    }

    entityDao.saveOrUpdate(mao);
    authorityManager.refreshGroupAuthorities(new GrantedAuthorityBean(mao.getName()));
View Full Code Here

    List<Group> groups = userService.getGroups(user, GroupMember.Ship.MEMBER);
    for (final Group group : groups) {
      List<Authority> groupAuths = getAuthorities(group);
      for (final Authority groupAuth : groupAuths) {
        if (authorities.containsKey(groupAuth.getResource())) {
          Authority existed = authorities.get(groupAuth.getResource());
          existed.merge(groupAuth);
        } else {
          authorities.put(groupAuth.getResource(), groupAuth);
        }
      }
    }
View Full Code Here

    return CollectUtils.newArrayList(authorities.values());
  }

  public Authority getAuthority(User user, Resource resource) {
    if ((null == user) || null == resource) return null;
    Authority au = null;
    List<Group> groups = userService.getGroups(user, GroupMember.Ship.MEMBER);
    for (final Group one : groups) {
      Authority ar = getAuthority(one, resource);
      if (null == au) {
        au = ar;
      } else {
        au.merge(ar);
      }
View Full Code Here

      }
    }
    group.getAuthorities().clear();
    group.getAuthorities().addAll(reserved);
    // 新权限
    Authority model = null;
    try {
      model = (Authority) Model.newInstance(Authority.class);
    } catch (Exception e) {
      throw new RuntimeException("cannot init authroity by class:" + Authority.class);
    }
    model.setGroup(group);
    for (final Resource element : resources) {
      Authority authority = (Authority) model.clone();
      authority.setResource(element);
      group.getAuthorities().add(authority);
    }
    entityDao.saveOrUpdate(group);
  }
View Full Code Here

TOP

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

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.