Exemplo n.º 1
0
  public List<Permission> getRolePermissions(int id) {

    List<Permission> permissionForRole = new ArrayList<Permission>(); // 角色拥有的权限
    List<RolePermission> rolePermissions = rolePermissionDaoImpl.getRolePermissions(id);
    Permission permission = null;
    for (RolePermission rolePermission : rolePermissions) {
      int permissionId = rolePermission.getPermissionId();
      permission = permissionDaoImpl.getPermission(permissionId);
      permissionForRole.add(permission);
    }

    return permissionForRole;
  }
Exemplo n.º 2
0
  public List<Permission> getRolePermissions(String[] rolePermissions) {

    List<Permission> permissionForRole = new ArrayList<Permission>(); // 角色修改后的权限
    Permission permission = null;
    for (String rolePermission : rolePermissions) {

      int permissionId = Integer.parseInt(rolePermission);
      permission = permissionDaoImpl.getPermission(permissionId);

      permissionForRole.add(permission);
    }

    return permissionForRole;
  }