package com.njcn.service.user;

import com.njcn.pojo.commons.ZtreePojo;
import com.njcn.pojo.user.Permission;
import com.njcn.pojo.user.PermissionTree;

import java.util.List;

public interface IPermissionService {
	List<PermissionTree> getTreeData();
	List<List> getAllData();
	List<List> getData(Integer index);
	List<List> getRolePermission();
	List<Permission> quarrAll(Integer nodeIndex,  Integer parentIndex, String sysType);

	/**
	 * 根据角色索引，获取其拥有的资源
	 * @param roleIndex
	 * @return
	 */
	List<ZtreePojo> getPermissions(String roleIndex);

	List<ZtreePojo> destributePermission(String roleIndex);

	/**
	 * 根据角色索引，重新分配资源
	 * @param roleIndex
	 * @param permissionIndex
	 * @return
	 */
	String disPer(String roleIndex, String permissionIndex);
	
	/**
	 * 保存资源
	 * @param description
	 * @param name
	 * @param path
	 * @param first
	 * @param second
	 * @return
	 */
	String savePermission(String description, String name, String path, Integer first, Integer second);
	String deleteByIndex(String functionIndex);

}
