package com.vci.web.service;
|
|
import com.vci.frameworkcore.pagemodel.SmUserVO;
|
import com.vci.starter.web.exception.VciBaseException;
|
|
/**
|
* web端的密级服务
|
*/
|
public interface WebSecretServiceI {
|
|
|
/**
|
* 获取用户密级的最小值
|
* @return 密级的值
|
* @throws VciBaseException 查询出错会抛出异常
|
*/
|
int getMinUserSecret() throws VciBaseException;
|
|
/**
|
* 获取数据密级的默认值
|
* @return 密级的值
|
* @throws VciBaseException 查询出错会抛出异常
|
*/
|
int getMinDataSecret() throws VciBaseException;
|
|
/**
|
* 获取IP密级的默认值
|
* @return 密级的值
|
* @throws VciBaseException 查询出错会抛出异常
|
*/
|
int getMinIpSecret() throws VciBaseException;
|
|
/**
|
* 获取用户密级
|
* @param userId 用户主键
|
* @return 用户的密级
|
* @throws VciBaseException 参数错误,用户不存在会抛出异常
|
*/
|
int getUserSecret(String userId) throws VciBaseException ;
|
|
/**
|
* 获取用户密级
|
* @param userVO 用户的显示对象
|
* @return 用户的密级
|
* @throws VciBaseException 参数错误,用户不存在会抛出异常
|
*/
|
int getUserSecret(SmUserVO userVO) throws VciBaseException;
|
|
/**
|
* 校验当前用户是否有权限访问数据
|
* @param secret 数据的密级
|
* @return true表示允许访问
|
*/
|
boolean checkDataSecret(int secret);
|
|
/**
|
* 校验用户的密级是否是否有权限访问数据
|
* @param secret 数据的密级
|
* @param userSecret 用户密级
|
* @return true表示允许访问
|
*/
|
boolean checkDataSecret(int secret, int userSecret) ;
|
|
/**
|
* 根据用户名来校验数据密级
|
* @param secret 数据的密级
|
* @param userId 用户名
|
* @return true表示允许访问
|
* @throws VciBaseException 参数错误,用户不存在会抛出异常
|
*/
|
boolean checkDataSecret(int secret, String userId) throws VciBaseException;
|
|
/**
|
* 根据用户对象来校验数据密级
|
* @param secret 数据的密级
|
* @param userVO 用户的显示对象
|
* @return true表示允许访问
|
*/
|
boolean checkDataSecret(int secret, SmUserVO userVO) ;
|
|
/**
|
* 获取IP地址的密级
|
* @param ip ip地址
|
* @return 密级的值
|
* @throws VciBaseException 查询出错的时候会抛出异常
|
*/
|
int getIpSecret(String ip) throws VciBaseException;
|
/**
|
* 检查机器密级
|
* @param ipSecret 机器密级
|
* @param userSecret 用户的密级
|
* @return 密级的值
|
*/
|
boolean checkIpSecret(int ipSecret, int userSecret);
|
|
/**
|
* 检查当前用户是否符合机器密级
|
* @param ipSecret 机器密级
|
* @return true表示允许访问
|
*/
|
boolean checkIpSecret(int ipSecret) ;
|
|
/**
|
* 校验指定ip和用户是否符合机器密级
|
* @param ip ip地址
|
* @param userId 用户名
|
* @return true表示允许访问
|
* @throws VciBaseException 参数错误,用户不存在会抛出异常
|
*/
|
boolean checkIpSecret(String ip, String userId) throws VciBaseException;
|
|
/**
|
* 校验指定IP和用户对象符合机器密级
|
* @param ip ip地址
|
* @param userVO 用户对象
|
* @return true表示允许访问
|
*/
|
boolean checkIpSecret(String ip, SmUserVO userVO) ;
|
|
}
|