Package org.beangle.ems.security

Examples of org.beangle.ems.security.Authority


    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().removeAll(removed);

    for (Resource resource : resources) {
      Authority authority = Model.newInstance(Authority.class);
      authority.setGroup(group);
      authority.setResource(resource);
      group.getAuthorities().add(authority);
    }
    entityDao.remove(removed);
    entityDao.saveOrUpdate(group);
    publish(new GroupAuthorityEvent(group));
View Full Code Here

    // 删除菜单和系统资源
    mao.getAuthorities().removeAll(removedAuthorities);

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

    entityDao.remove(removedAuthorities);
    entityDao.saveOrUpdate(mao);
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

    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().removeAll(removed);

    for (Resource resource : resources) {
      Authority authority = Model.newInstance(Authority.class);
      authority.setGroup(group);
      authority.setResource(resource);
      group.getAuthorities().add(authority);
    }
    entityDao.remove(removed);
    entityDao.saveOrUpdate(group);
    publish(new GroupAuthorityEvent(group));
View Full Code Here

TOP

Related Classes of org.beangle.ems.security.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.