Package org.beangle.ems.security

Examples of org.beangle.ems.security.Authority


    List<Group> groups = user.getGroups();
    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 = user.getGroups();
    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

    List<Group> groups = user.getGroups();
    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 = user.getGroups();
    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.