说明:
DataTable 为一个结果集,表数据的意思。
BaseUserInfo 为当前操作员信息的类,当前用户的意思。
Java 接口可能第一个字母习惯于小写。
//-------------------------------------------------------------------------------------
// All Rights Reserved , Copyright (C) 2011 , Hairihan TECH, Ltd.
//-------------------------------------------------------------------------------------
using System.Data;
using System.ServiceModel;
namespace DotNet.IService
{
using DotNet.Utilities;
/// <summary>
/// IPermissionService
/// 与权限判断等相关的接口定义
///
/// 修改纪录
///
///
2011.04.30 版本:2.0 JiRiGaLa 整理接口注释。
///
2010.07.06 版本:1.9 JiRiGaLa 数据集权限进行优化处理,统一处理删除标志功能。
///
2010.05.24 版本:1.8 JiRiGaLa 增加 角色的权限判断。
///
2009.09.09 版本:1.7 JiRiGaLa 增加 GetUserPermissionScope、GetOrganizeIdsByPermission、GetRoleIdsByPermission、GetUserIdsByPermission。
///
2008.11.28 版本:1.6 JiRiGaLa 整理为52个标准接口定义,完善 GetLicensePermissionByUser 接口定义。
///
2008.11.27 版本:1.5 JiRiGaLa 整理为50个标准接口定义,有些permissionItemCode修改为permissionItemId。
///
2008.11.27 版本:1.5 JiRiGaLa 接口改进为B/S系统适合的接口定义 整理为45个标准接口定义。
///
2008.11.26 版本:1.4 JiRiGaLa 将权限相关的类方法集中到 IPermissionService 接口中。
///
2008.09.02 版本:1.3 JiRiGaLa 将命名修改为 IPermissionService 。
///
2008.06.12 版本:1.2 JiRiGaLa 传递类对象。
///
2008.05.09 版本:1.1 JiRiGaLa 命名修改为 IPermissionService。
///
2008.03.23 版本:1.0 JiRiGaLa 添加权限。
///
/// 版本:2.0
///
/// <author>
///
<name>JiRiGaLa</name>
///
<date>2011.04.30</date>
/// </author>
/// </summary>
[ServiceContract]
public interface IPermissionService
{
//
/// 用户权限判断相关(需要实现对外调用)
//
/// <summary>
/// 01.用户是否在指定的角色里
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="roleName">角色名称</param>
/// <returns>在角色里</returns>
[OperationContract]
bool IsInRole(BaseUserInfo userInfo, string userId, string roleName);
/// <summary>
/// 02.当前用户是否有相应的操作权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="permissionItemCode">操作权限编号</param>
/// <returns>是否有权限</returns>
[OperationContract]
bool IsAuthorized(BaseUserInfo userInfo, string permissionItemCode);
/// <summary>
/// 03.某个用户是否有相应的权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemCode">操作权限编号</param>
/// <returns>是否有权限</returns>
[OperationContract]
bool IsAuthorizedByUser(BaseUserInfo userInfo, string userId, string permissionItemCode);
/// <summary>
/// 04.某个角色是否有相应的权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="permissionItemCode">权限编号</param>
/// <returns>是否有权限</returns>
[OperationContract]
bool IsAuthorizedByRole(BaseUserInfo userInfo, string roleId, string permissionItemCode);
/// <summary>
/// 05.当前用户是否超级管理员
/// </summary>
/// <param name="userInfo"></param>
/// <returns></returns>
[OperationContract]
bool IsAdministrator(BaseUserInfo userInfo);
/// <summary>
/// 06.某个用户是否超级管理员
/// </summary>
/// <param name="userInfo"></param>
/// <param name="userId"></param>
/// <returns></returns>
[OperationContract]
bool IsAdministratorByUser(BaseUserInfo userInfo, string userId);
/// <summary>
/// 07.获得当前用户的所有权限列表
/// </summary>
/// <param name="userInfo">用户</param>
/// <returns>数据表</returns>
[OperationContract]
DataTable GetPermissionDT(BaseUserInfo userInfo);
/// <summary>
/// 08.获得某个用户的所有权限列表
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <returns>数据表</returns>
[OperationContract]
DataTable GetPermissionDTByUser(BaseUserInfo userInfo, string userId);
/// <summary>
/// 09.当前用户是否对某个模块有相应的权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="moduleCode">模块编号</param>
/// <returns>是否有权限</returns>
[OperationContract]
bool ModuleIsAuthorized(BaseUserInfo userInfo, string moduleCode);
/// <summary>
/// 10.某个用户是否对某个模块有相应的权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="moduleCode">模块编号</param>
/// <returns>是否有权限</returns>
[OperationContract]
bool ModuleIsAuthorizedByUser(BaseUserInfo userInfo, string userId, string moduleCode);
/// <summary>
/// 11.获得用户的数据集权限范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemScopeCode">权限域编号</param>
/// <returns>数据集权限范围</returns>
[OperationContract]
PermissionScope GetUserPermissionScope(BaseUserInfo userInfo, string userId, string permissionItemScopeCode);
//
/// 用户权限范围判断相关(需要实现对外调用)
//
/// <summary>
/// 12.按某个数据集权限获取组织列表
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemScopeCode">权限域编号</param>
/// <returns>数据表</returns>
[OperationContract]
DataTable GetOrganizeDTByPermission(BaseUserInfo userInfo, string userId, string permissionItemScopeCode);
/// <summary>
/// 13.按某个数据集权限获取组织主键数组
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemScopeCode">权限域编号</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetOrganizeIdsByPermission(BaseUserInfo userInfo, string userId, string permissionItemScopeCode);
/// <summary>
/// 14.按某个数据集权限获取角色列表
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemScopeCode">权限域编号</param>
/// <returns>数据表</returns>
[OperationContract]
DataTable GetRoleDTByPermission(BaseUserInfo userInfo, string userId, string permissionItemScopeCode);
/// <summary>
/// 15.按某个数据集权限获取角色主键数组
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemScopeCode">权限域编号</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetRoleIdsByPermission(BaseUserInfo userInfo, string userId, string permissionItemScopeCode);
/// <summary>
/// 16.按某个权限域获取用户列表
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemScopeCode">权限域编号</param>
/// <returns>数据表</returns>
[OperationContract]
DataTable GetUserDTByPermission(BaseUserInfo userInfo, string userId, string permissionItemScopeCode);
/// <summary>
/// 17.按某个数据集权限获取用户主键数组
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemScopeCode">权限域编号</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetUserIdsByPermission(BaseUserInfo userInfo, string userId, string permissionItemScopeCode);
/// <summary>
/// 18.按某个权限域获取模块列表
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemCode">权限域编号</param>
/// <returns>数据表</returns>
[OperationContract]
DataTable GetModuleDTByPermission(BaseUserInfo userInfo, string userId, string permissionItemCode);
/// <summary>
/// 19.有授权权限的权限列表
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemCode">权限域编号</param>
/// <returns>数据表</returns>
[OperationContract]
DataTable GetPermissionItemDTByPermission(BaseUserInfo userInfo, string userId, string permissionItemCode);
//
/// 角色权限关联关系相关
//
/// <summary>
/// 20.获取角色权限主键数组
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetRolePermissionIds(BaseUserInfo userInfo, string roleId);
/// <summary>
/// 21.授予角色的权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="grantPermissionIds">授予权限数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int GrantRolePermissions(BaseUserInfo userInfo, string roleId, string[] grantPermissionIds);
/// <summary>
/// 22.授予角色的权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="grantPermissionId">授予权限</param>
/// <returns>影响的行数</returns>
[OperationContract]
string GrantRolePermission(BaseUserInfo userInfo, string roleId, string grantPermissionId);
/// <summary>
/// 23.授予角色的权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="grantPermissionId">授予权限</param>
/// <returns>影响的行数</returns>
[OperationContract]
string GrantRolePermissionById(BaseUserInfo userInfo, string roleId, string grantPermissionId);
/// <summary>
/// 24.撤消角色的权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="grantPermissionIds">授予权限数组</param>
/// <param name="revokePermissionIds">撤消权限数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokeRolePermissions(BaseUserInfo userInfo, string roleId, string[] revokePermissionIds);
/// <summary>
/// 25.撤消角色的权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="revokePermissionId">撤消权限数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokeRolePermission(BaseUserInfo userInfo, string roleId, string revokePermissionId);
/// <summary>
/// 26.撤消角色的权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="revokePermissionId">撤消权限数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokeRolePermissionById(BaseUserInfo userInfo, string roleId, string revokePermissionId);
/// <summary>
/// 27.获取角色的某个权限域的组织范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="permissionItemId">权限主键</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetRoleScopeUserIds(BaseUserInfo userInfo, string roleId, string permissionItemCode);
/// <summary>
/// 28.获取角色的某个权限域的组织范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="permissionItemId">权限主键</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetRoleScopeRoleIds(BaseUserInfo userInfo, string roleId, string permissionItemCode);
/// <summary>
/// 29.获取角色的某个权限域的组织范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="permissionItemCode">权限编号</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetRoleScopeOrganizeIds(BaseUserInfo userInfo, string roleId, string permissionItemCode);
/// <summary>
/// 30.授予角色的某个权限域的组织范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="permissionItemId">权限主键</param>
/// <param name="grantUserIds">授予用户主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int GrantRoleUserScopes(BaseUserInfo userInfo, string roleId, string permissionItemCode, string[] grantUserIds);
/// <summary>
/// 31.撤消角色的某个权限域的组织范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="permissionItemId">权限主键</param>
/// <param name="revokeUserIds">撤消的用户主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokeRoleUserScopes(BaseUserInfo userInfo, string roleId, string permissionItemCode, string[] revokeUserIds);
/// <summary>
/// 32.授予角色的某个权限域的组织范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="permissionItemId">权限主键</param>
/// <param name="grantRoleIds">授予角色主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int GrantRoleRoleScopes(BaseUserInfo userInfo, string roleId, string permissionItemCode, string[] grantRoleIds);
/// <summary>
/// 33.撤消角色的某个权限域的组织范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="permissionItemId">权限主键</param>
/// <param name="revokeRoleIds">撤消的角色主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokeRoleRoleScopes(BaseUserInfo userInfo, string roleId, string permissionItemCode, string[] revokeRoleIds);
/// <summary>
/// 34.授予角色的某个权限域的组织范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="permissionItemCode">权限主键</param>
/// <param name="grantOrganizeIds">授予组织主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int GrantRoleOrganizeScopes(BaseUserInfo userInfo, string roleId, string permissionItemCode, string[] grantOrganizeIds);
/// <summary>
/// 35.撤消角色的某个权限域的组织范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="permissionItemCode">权限主键</param>
/// <param name="revokeOrganizeIds">撤消的组织主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokeRoleOrganizeScopes(BaseUserInfo userInfo, string roleId, string permissionItemCode, string[] revokeOrganizeIds);
/// <summary>
/// 36.获取角色授权权限列表
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="permissionItemCode">操作权限项编号</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetRoleScopePermissionIds(BaseUserInfo userInfo, string roleId, string permissionItemCode);
/// <summary>
/// 37.授予角色的授权权限范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="permissionItemCode">操作权限编号</param>
/// <param name="grantPermissionIds">授予的权限主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int GrantRolePermissionItemScopes(BaseUserInfo userInfo, string roleId, string permissionItemCode, string[] grantPermissionIds);
/// <summary>
/// 38.授予角色的授权权限范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="permissionItemCode">操作权限编号</param>
/// <param name="revokePermissionIds">撤消的权限主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokeRolePermissionItemScopes(BaseUserInfo userInfo, string roleId, string permissionItemIdCode, string[] revokePermissionIds);
/// <summary>
/// 39.清除权限
/// </summary>
/// <param name="userInfo">操作员</param>
/// <param name="id">主键</param>
/// <returns>数据表</returns>
[OperationContract]
int ClearRolePermission(BaseUserInfo userInfo, string id);
[OperationContract]
int ClearRolePermissionScope(BaseUserInfo userInfo, string id, string permissionItemIdCode);
//
/// 用户权限关联关系相关
//
/// <summary>
/// 40.获取用户权限主键数组
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetUserPermissionIds(BaseUserInfo userInfo, string userId);
/// <summary>
/// 41.授予用户的权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="grantPermissionIds">授予权限数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int GrantUserPermissions(BaseUserInfo userInfo, string userId, string[] grantPermissionIds);
/// <summary>
/// 42.授予用户的权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="grantPermissionId">授予权限数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
string GrantUserPermissionById(BaseUserInfo userInfo, string userId, string grantPermissionId);
/// <summary>
/// 43.撤消用户的权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="revokePermissionIds">撤消权限数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokeUserPermission(BaseUserInfo userInfo, string userId, string[] revokePermissionIds);
/// <summary>
/// 44.撤消用户的权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="revokePermissionId">撤消权限</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokeUserPermissionById(BaseUserInfo userInfo, string userId, string revokePermissionId);
/// <summary>
/// 45.获取用户的某个权限域的组织范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemIdCode">权限主键</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetUserScopeOrganizeIds(BaseUserInfo userInfo, string userId, string permissionItemIdCode);
/// <summary>
/// 46.设置用户的某个权限域的组织范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemIdCode">权限主键</param>
/// <param name="grantOrganizeIds">授予的组织主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int GrantUserOrganizeScopes(BaseUserInfo userInfo, string userId, string permissionItemIdCode, string[] grantOrganizeIds);
/// <summary>
/// 47.设置用户的某个权限域的组织范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemIdCode">权限主键</param>
/// <param name="revokeOrganizeIds">撤消的组织主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokeUserOrganizeScopes(BaseUserInfo userInfo, string userId, string permissionItemIdCode, string[] revokeOrganizeIds);
/// <summary>
/// 48.获取用户的某个权限域的用户范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemIdCode">权限主键</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetUserScopeUserIds(BaseUserInfo userInfo, string userId, string permissionItemIdCode);
/// <summary>
/// 49.设置用户的某个权限域的用户范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemIdCode">权限主键</param>
/// <param name="grantUserIds">授予的用户主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int GrantUserUserScopes(BaseUserInfo userInfo, string userId, string permissionItemIdCode, string[] grantUserIds);
/// <summary>
/// 50.设置用户的某个权限域的用户范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemIdCode">权限主键</param>
/// <param name="revokeUserIds">撤消的用户主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokeUserUserScopes(BaseUserInfo userInfo, string userId, string permissionItemIdCode, string[] revokeUserIds);
/// <summary>
/// 51.获取用户的某个权限域的用户范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemIdCode">权限主键</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetUserScopeRoleIds(BaseUserInfo userInfo, string userId, string permissionItemIdCode);
/// <summary>
/// 52.设置用户的某个权限域的用户范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemIdCode">权限主键</param>
/// <param name="grantUserIds">授予的用户主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int GrantUserRoleScopes(BaseUserInfo userInfo, string userId, string permissionItemIdCode, string[] grantRoleIds);
/// <summary>
/// 53.设置用户的某个权限域的用户范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemIdCode">权限主键</param>
/// <param name="revokeUserIds">撤消的用户主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokeUserRoleScopes(BaseUserInfo userInfo, string userId, string permissionItemIdCode, string[] revokeRoleds);
/// <summary>
/// 54.获取用户授权权限列表
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetUserScopePermissionIds(BaseUserInfo userInfo, string userId, string permissionItemIdCode);
/// <summary>
/// 55.授予用户的授权权限范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="grantPermissionIds">授予的权限主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int GrantUserPermissionItemScopes(BaseUserInfo userInfo, string userId, string permissionItemIdCode, string[] grantPermissionIds);
/// <summary>
/// 56.撤消用户的授权权限范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="revokePermissionIds">撤消的权限主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokeUserPermissionItemScopes(BaseUserInfo userInfo, string userId, string permissionItemIdCode, string[] revokePermissionIds);
/// <summary>
/// 57.清除权限
/// </summary>
/// <param name="userInfo">操作员</param>
/// <param name="id">主键</param>
/// <returns>数据表</returns>
[OperationContract]
int ClearUserPermission(BaseUserInfo userInfo, string id);
/// <summary>
/// 58.
/// </summary>
/// <param name="userInfo"></param>
/// <param name="id"></param>
/// <param name="permissionItemIdCode"></param>
/// <returns></returns>
[OperationContract]
int ClearUserPermissionScope(BaseUserInfo userInfo, string id, string permissionItemIdCode);
//
/// 用户关联模块关系相关
//
/// <summary>
/// 59.获得用户有权限的模块
/// </summary>
/// <param name="userInfo">用户</param>
/// <returns>数据表</returns>
[OperationContract]
DataTable GetModuleDT(BaseUserInfo userInfo);
/// <summary>
/// 60.获得用户有权限的模块
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <returns>数据表</returns>
[OperationContract]
DataTable GetModuleDTByUser(BaseUserInfo userInfo, string userId);
/// <summary>
/// 61.获取用户模块权限范围主键数组
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="permissionItemCode">权限编号</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetUserScopeModuleIds(BaseUserInfo userInfo, string userId, string permissionItemCode);
/// <summary>
/// 62.授予用户模块的权限范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="grantModuleId">授予模块主键</param>
/// <returns>影响的行数</returns>
[OperationContract]
string GrantUserModuleScope(BaseUserInfo userInfo, string userId, string permissionScopeItemCode, string grantModuleId);
/// <summary>
/// 63.授予用户模块的权限范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="grantModuleIds">授予模块主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int GrantUserModuleScopes(BaseUserInfo userInfo, string userId, string permissionScopeItemCode, string[] grantModuleIds);
/// <summary>
/// 64.撤消用户模块的权限范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="revokeModuleId">撤消模块主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokeUserModuleScope(BaseUserInfo userInfo, string userId, string permissionScopeItemCode, string revokeModuleId);
/// <summary>
/// 65.撤消用户模块的权限范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="revokeModuleIds">撤消模块主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokeUserModuleScopes(BaseUserInfo userInfo, string userId, string permissionScopeItemCode, string[] revokeModuleIds);
//
/// 角色模块关联关系相关
//
/// <summary>
/// 66.获取用户模块权限范围主键数组
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="permissionItemCode">权限编号</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetRoleScopeModuleIds(BaseUserInfo userInfo, string roleId, string permissionItemCode);
/// <summary>
/// 67.授予用户模块的权限范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="grantModuleIds">授予模块主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int GrantRoleModuleScopes(BaseUserInfo userInfo, string roleId, string permissionItemScopeCode, string[] grantModuleIds);
/// <summary>
/// 68.授予用户模块的权限范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="grantModuleId">授予模块主键</param>
/// <returns>影响的行数</returns>
[OperationContract]
string GrantRoleModuleScope(BaseUserInfo userInfo, string roleId, string permissionItemScopeCode, string grantModuleId);
/// <summary>
/// 69.撤消用户模块的权限范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="revokeModuleIds">撤消模块主键数组</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokeRoleModuleScopes(BaseUserInfo userInfo, string roleId, string permissionItemScopeCode, string[] revokeModuleIds);
/// <summary>
/// 70.撤消用户模块的权限范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="roleId">角色主键</param>
/// <param name="revokeModuleId">撤消模块主键</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokeRoleModuleScope(BaseUserInfo userInfo, string roleId, string permissionItemScopeCode, string revokeModuleId);
//
/// 资源权限设定关系相关
//
/// <summary>
/// 71.获取资源权限主键数组
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="resourceCategory">资源分类</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetResourcePermissionIds(BaseUserInfo userInfo, string resourceCategory, string resourceId);
/// <summary>
/// 72.授予资源的权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="resourceCategory">资源分类</param>
/// <param name="resourceId">资源主键</param>
/// <param name="grantPermissionID">权限主键</param>
/// <returns>影响的行数</returns>
[OperationContract]
int GrantResourcePermission(BaseUserInfo userInfo, string resourceCategory, string resourceId, string[] grantPermissionIds);
/// <summary>
/// 73.撤消资源的权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="resourceCategory">资源分类</param>
/// <param name="resourceId">资源主键</param>
/// <param name="revokePermissionID">权限主键</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokeResourcePermission(BaseUserInfo userInfo, string resourceCategory, string resourceId, string[] revokePermissionIds);
//
/// 资源权限范围设定关系相关
//
/// <summary>
/// 74.获取资源权限范围主键数组
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="resourceCategory">资源分类</param>
/// <param name="resourceId">资源主键</param>
/// <param name="targetCategory">目标类别</param>
/// <param name="permissionItemCode">权限编号</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetPermissionScopeTargetIds(BaseUserInfo userInfo, string resourceCategory, string resourceId, string targetCategory, string permissionItemCode);
/// <summary>
/// 75.获取数据集权限目标主键
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="resourceCategory">资源类别</param>
/// <param name="targetResourceId">资源主键</param>
/// <param name="targetResourceCategory">目标资源</param>
/// <param name="permissionItemCode">权限编号</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetPermissionScopeResourceIds(BaseUserInfo userInfo, string resourceCategory, string targetResourceId, string targetResourceCategory, string permissionItemCode);
/// <summary>
/// 76.授予资源的权限范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="resourceCategory">资源分类</param>
/// <param name="resourceId">资源主键</param>
/// <param name="targetCategory">目标类别</param>
/// <param name="grantTargetIds">目标主键数组</param>
/// <param name="permissionItemId">权限主键</param>
/// <returns>影响的行数</returns>
[OperationContract]
int GrantPermissionScopeTargets(BaseUserInfo userInfo, string resourceCategory, string resourceId, string targetCategory, string[] grantTargetIds, string permissionItemId);
/// <summary>
/// 77.授予数据集权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="resourceCategory">资源类别</param>
/// <param name="resourceIds">资源主键数组</param>
/// <param name="targetCategory">目标资源类别</param>
/// <param name="grantTargetId">目标资源主键</param>
/// <param name="permissionItemId">权限主键</param>
/// <returns>影响行数</returns>
int GrantPermissionScopeTarget(BaseUserInfo userInfo, string resourceCategory, string[] resourceIds, string targetCategory, string grantTargetId, string permissionItemId);
/// <summary>
/// 78.撤消资源的权限范围
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="resourceCategory">资源分类</param>
/// <param name="resourceId">资源主键</param>
/// <param name="targetCategory">目标类别</param>
/// <param name="revokeTargetIds">目标主键数组</param>
/// <param name="permissionItemId">权限主键</param>
/// <returns>影响的行数</returns>
[OperationContract]
int RevokePermissionScopeTargets(BaseUserInfo userInfo, string resourceCategory, string resourceId, string targetCategory, string[] revokeTargetIds, string permissionItemId);
/// <summary>
/// 79.撤销数据集权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="resourceCategory">资源类别</param>
/// <param name="resourceIds">资源主键数组</param>
/// <param name="targetCategory">目标分类</param>
/// <param name="revokeTargetId">目标主键</param>
/// <param name="permissionItemId">权限主键</param>
/// <returns>影响行数</returns>
[OperationContract]
int RevokePermissionScopeTarget(BaseUserInfo userInfo, string resourceCategory, string[] resourceIds, string targetCategory, string revokeTargetId, string permissionItemId);
/// <summary>
/// 80.清除数据集权限
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="resourceCategory">资源类别</param>
/// <param name="resourceId">资源主键</param>
/// <param name="targetCategory">目标类别</param>
/// <param name="permissionItemId">权限主键</param>
/// <returns>影响行数</returns>
[OperationContract]
int ClearPermissionScopeTarget(BaseUserInfo userInfo, string resourceCategory, string resourceId, string targetCategory, string permissionItemId);
/// <summary>
/// 81.获取用户的某个资源的权限范围(列表资源)
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="targetCategory">目标类别</param>
/// <param name="permissionItemCode">权限编号</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetResourceScopeIds(BaseUserInfo userInfo, string userId, string targetCategory, string permissionItemCode);
/// <summary>
/// 82.获取用户的某个资源的权限范围(树型资源)
/// </summary>
/// <param name="userInfo">用户</param>
/// <param name="userId">用户主键</param>
/// <param name="targetCategory">目标类别</param>
/// <param name="permissionItemCode">权限编号</param>
/// <param name="childrens">是否含子节点</param>
/// <returns>主键数组</returns>
[OperationContract]
string[] GetTreeResourceScopeIds(BaseUserInfo userInfo, string userId, string targetCategory, string permissionItemCode, bool childrens);
}
}
1 //------------------------------------------------------------
2 // All Rights Reserved , Copyright (C) 2008 , Jirisoft , Ltd.
3 //------------------------------------------------------------
4
5 using System;
6 using System.Data;
7
8 namespace DotNet.Common.IService
9 {
10 using DotNet.Common.Model;
11 using DotNet.Common.Utilities;
12
13 /// <summary>
14 /// IPermissionService
15 /// 与权限判断等相关的接口定义
16 ///
17 /// 修改纪录
18 ///
19 /// 2008.11.28 版本:1.6 JiRiGaLa 整理为52个标准接口定义,完善 GetLicensePermissionByUser 接口定义。
20 /// 2008.11.27 版本:1.5 JiRiGaLa 整理为50个标准接口定义,有些permissionCode修改为permissionID。
21 /// 2008.11.27 版本:1.5 JiRiGaLa 接口改进为B/S系统适合的接口定义 整理为45个标准接口定义。
22 /// 2008.11.26 版本:1.4 JiRiGaLa 将权限相关的类方法集中到 IPermissionService 接口中。
23 /// 2008.09.02 版本:1.3 JiRiGaLa 将命名修改为 IPermissionService 。
24 /// 2008.06.12 版本:1.2 JiRiGaLa 传递类对象。
25 /// 2008.05.09 版本:1.1 JiRiGaLa 命名修改为 IPermissionService。
26 /// 2008.03.23 版本:1.0 JiRiGaLa 添加权限。
27 ///
28 /// 版本:1.4
29 ///
30 /// <author>
31 /// <name>JiRiGaLa</name>
32 /// <date>2008.11.26</date>
33 /// </author>
34 /// </summary>
35 public interface IPermissionService
36 {
37 /// <summary>
38 /// 加载服务层
39 /// </summary>
40 void Load();
41
42
43 //
44 /// 用户权限判断相关(需要实现对外调用)
45 //
46
47
48 /// <summary>
49 /// 01.当前用户是否有相应的权限
50 /// </summary>
51 /// <param name="userInfo">用户</param>
52 /// <param name="permissionCode">权限编号</param>
53 /// <returns>是否有权限</returns>
54 bool Authorization(BaseUserInfo userInfo, String permissionCode);
55
56 /// <summary>
57 /// 02.某个用户是否有相应的权限
58 /// </summary>
59 /// <param name="userInfo">用户</param>
60 /// <param name="userID">用户代码</param>
61 /// <param name="permissionCode">权限编号</param>
62 /// <returns>是否有权限</returns>
63 bool AuthorizationByUser(BaseUserInfo userInfo, String userID, String permissionCode);
64
65 /// <summary>
66 /// 03.当前用户是否超级管理员
67 /// </summary>
68 /// <param name="userInfo"></param>
69 /// <returns></returns>
70 bool IsAdministrator(BaseUserInfo userInfo);
71
72 /// <summary>
73 /// 04.某个用户是否超级管理员
74 /// </summary>
75 /// <param name="userInfo"></param>
76 /// <param name="userID"></param>
77 /// <returns></returns>
78 bool IsAdministratorByUser(BaseUserInfo userInfo, String userID);
79
80 /// <summary>
81 /// 05.获得当前用户的所有权限列表
82 /// </summary>
83 /// <param name="userInfo">用户</param>
84 /// <returns>数据表</returns>
85 DataTable GetPermissionList(BaseUserInfo userInfo);
86
87 /// <summary>
88 /// 06.获得某个用户的所有权限列表
89 /// </summary>
90 /// <param name="userInfo">用户</param>
91 /// <param name="userID">用户代码</param>
92 /// <returns>数据表</returns>
93 DataTable GetPermissionListByUser(BaseUserInfo userInfo, String userID);
94
95 /// <summary>
96 /// 07.当前用户是否对某个模块有相应的权限
97 /// </summary>
98 /// <param name="userInfo">用户</param>
99 /// <param name="moduleCode">模块编号</param>
100 /// <returns>是否有权限</returns>
101 bool ModuleAuthorization(BaseUserInfo userInfo, String moduleCode);
102
103 /// <summary>
104 /// 08.某个用户是否对某个模块有相应的权限
105 /// </summary>
106 /// <param name="userInfo">用户</param>
107 /// <param name="userID">用户代码</param>
108 /// <param name="moduleCode">模块编号</param>
109 /// <returns>是否有权限</returns>
110 bool ModuleAuthorizationByUser(BaseUserInfo userInfo, String userID, String moduleCode);
111
112
113 //
114 /// 用户权限范围判断相关(需要实现对外调用)
115 //
116
117 /// <summary>
118 /// 09.按某个权限域获取组织列表
119 /// </summary>
120 /// <param name="userInfo">用户</param>
121 /// <param name="userID">用户代码</param>
122 /// <param name="permissionScopeCode">权限域编号</param>
123 /// <returns>数据表</returns>
124 DataTable GetOrganizeListByPermission(BaseUserInfo userInfo, String userID, String permissionScopeCode);
125
126 /// <summary>
127 /// 10.按某个权限域获取角色列表
128 /// </summary>
129 /// <param name="userInfo">用户</param>
130 /// <param name="userID">用户代码</param>
131 /// <param name="permissionScopeCode">权限域编号</param>
132 /// <returns>数据表</returns>
133 DataTable GetRoleListByPermission(BaseUserInfo userInfo, String userID, String permissionScopeCode);
134
135 /// <summary>
136 /// 11.按某个权限域获取用户列表
137 /// </summary>
138 /// <param name="userInfo">用户</param>
139 /// <param name="userID">用户代码</param>
140 /// <param name="permissionScopeCode">权限域编号</param>
141 /// <returns>数据表</returns>
142 DataTable GetUserListByPermission(BaseUserInfo userInfo, String userID, String permissionScopeCode);
143
144 /// <summary>
145 /// 12.按某个权限域获取模块列表
146 /// </summary>
147 /// <param name="userInfo">用户</param>
148 /// <param name="userID">用户代码</param>
149 /// <param name="permissionCode">权限域编号</param>
150 /// <returns>数据表</returns>
151 DataTable GetModuleListByPermission(BaseUserInfo userInfo, String userID, String permissionCode);
152
153 /// <summary>
154 /// 13.有授权权限的权限列表
155 /// </summary>
156 /// <param name="userInfo">用户</param>
157 /// <param name="userID">用户代码</param>
158 /// <returns>数据表</returns>
159 DataTable GetLicensePermissionByUser(BaseUserInfo userInfo, String userID);
160
161 /// <summary>
162 /// 14.用户的所有可授权范围(有授权权限的权限列表)
163 /// </summary>
164 /// <param name="userInfo">用户</param>
165 /// <param name="userID">用户代码</param>
166 /// <param name="permissionCode">权限域编号</param>
167 /// <returns>数据表</returns>
168 DataTable GetPermissionListByPermission(BaseUserInfo userInfo, String userID, String permissionCode);
169
170
171 //
172 /// 角色权限关联关系相关
173 //
174
175
176 /// <summary>
177 /// 15.获取角色权限代码数组
178 /// </summary>
179 /// <param name="userInfo">用户</param>
180 /// <param name="roleID">角色代码</param>
181 /// <returns>代码数组</returns>
182 String[] GetRolePermissionIDs(BaseUserInfo userInfo, String roleID);
183
184 /// <summary>
185 /// 16.授予角色的权限
186 /// </summary>
187 /// <param name="userInfo">用户</param>
188 /// <param name="roleID">角色代码</param>
189 /// <param name="grantPermissionIDs">授予权限数组</param>
190 /// <returns>影响的行数</returns>
191 int GrantRolePermission(BaseUserInfo userInfo, String roleID, String[] grantPermissionIDs);
192
193 /// <summary>
194 /// 17.撤消角色的权限
195 /// </summary>
196 /// <param name="userInfo">用户</param>
197 /// <param name="roleID">角色代码</param>
198 /// <param name="grantPermissionIDs">授予权限数组</param>
199 /// <param name="revokePermissionIDs">撤消权限数组</param>
200 /// <returns>影响的行数</returns>
201 int RevokeRolePermission(BaseUserInfo userInfo, String roleID, String[] revokePermissionIDs);
202
203 /// <summary>
204 /// 18.获取角色的某个权限域的组织范围
205 /// </summary>
206 /// <param name="userInfo">用户</param>
207 /// <param name="roleID">角色代码</param>
208 /// <param name="permissionID">权限代码</param>
209 /// <returns>代码数组</returns>
210 String[] GetRoleScopeOrganizeIDs(BaseUserInfo userInfo, String roleID, String permissionID);
211
212 /// <summary>
213 /// 19.授予角色的某个权限域的组织范围
214 /// </summary>
215 /// <param name="userInfo">用户</param>
216 /// <param name="roleID">角色代码</param>
217 /// <param name="permissionID">权限代码</param>
218 /// <param name="grantOrganizeIDs">授予组织代码数组</param>
219 /// <returns>影响的行数</returns>
220 int GrantRoleOrganizeScope(BaseUserInfo userInfo, String roleID, String permissionID, String[] grantOrganizeIDs);
221
222 /// <summary>
223 /// 20.撤消角色的某个权限域的组织范围
224 /// </summary>
225 /// <param name="userInfo">用户</param>
226 /// <param name="roleID">角色代码</param>
227 /// <param name="permissionID">权限代码</param>
228 /// <param name="revokeOrganizeIDs">撤消的组织代码数组</param>
229 /// <returns>影响的行数</returns>
230 int RevokeRoleOrganizeScope(BaseUserInfo userInfo, String roleID, String permissionID, String[] revokeOrganizeIDs);
231
232 /// <summary>
233 /// 21.获取角色授权权限列表
234 /// </summary>
235 /// <param name="userInfo">用户</param>
236 /// <param name="roleID">角色代码</param>
237 /// <returns>代码数组</returns>
238 String[] GetRoleLicensePermissionIDs(BaseUserInfo userInfo, String roleID);
239
240 /// <summary>
241 /// 22.授予角色的授权权限范围
242 /// </summary>
243 /// <param name="userInfo">用户</param>
244 /// <param name="roleID">角色代码</param>
245 /// <param name="grantPermissionIDs">授予的权限代码数组</param>
246 /// <returns>影响的行数</returns>
247 int GrantRoleLicensePermission(BaseUserInfo userInfo, String roleID, String[] grantPermissionIDs);
248
249 /// <summary>
250 /// 23.授予角色的授权权限范围
251 /// </summary>
252 /// <param name="userInfo">用户</param>
253 /// <param name="roleID">角色代码</param>
254 /// <param name="revokePermissionIDs">撤消的权限代码数组</param>
255 /// <returns>影响的行数</returns>
256 int RevokeRoleLicensePermission(BaseUserInfo userInfo, String roleID, String[] revokePermissionIDs);
257
258
259 //
260 /// 用户权限关联关系相关
261 //
262
263
264 /// <summary>
265 /// 24.获取用户权限代码数组
266 /// </summary>
267 /// <param name="userInfo">用户</param>
268 /// <param name="userID">用户代码</param>
269 /// <returns>代码数组</returns>
270 String[] GetUserPermissionIDs(BaseUserInfo userInfo, String userID);
271
272 /// <summary>
273 /// 25.授予用户的权限
274 /// </summary>
275 /// <param name="userInfo">用户</param>
276 /// <param name="userID">用户代码</param>
277 /// <param name="grantPermissionIDs">授予权限数组</param>
278 /// <returns>影响的行数</returns>
279 int GrantUserPermission(BaseUserInfo userInfo, String userID, String[] grantPermissionIDs);
280
281 /// <summary>
282 /// 26.撤消用户的权限
283 /// </summary>
284 /// <param name="userInfo">用户</param>
285 /// <param name="userID">用户代码</param>
286 /// <param name="revokePermissionIDs">撤消权限数组</param>
287 /// <returns>影响的行数</returns>
288 int RevokeUserPermission(BaseUserInfo userInfo, String userID, String[] revokePermissionIDs);
289
290 /// <summary>
291 /// 27.获取用户的某个权限域的组织范围
292 /// </summary>
293 /// <param name="userInfo">用户</param>
294 /// <param name="userID">用户代码</param>
295 /// <param name="permissionID">权限代码</param>
296 /// <returns>代码数组</returns>
297 String[] GetUserScopeOrganizeIDs(BaseUserInfo userInfo, String userID, String permissionID);
298
299 /// <summary>
300 /// 28.设置用户的某个权限域的组织范围
301 /// </summary>
302 /// <param name="userInfo">用户</param>
303 /// <param name="userID">用户代码</param>
304 /// <param name="permissionID">权限代码</param>
305 /// <param name="grantOrganizeIDs">授予的组织代码数组</param>
306 /// <returns>影响的行数</returns>
307 int GrantUserOrganizeScope(BaseUserInfo userInfo, String userID, String permissionID, String[] grantOrganizeIDs);
308
309 /// <summary>
310 /// 29.设置用户的某个权限域的组织范围
311 /// </summary>
312 /// <param name="userInfo">用户</param>
313 /// <param name="userID">用户代码</param>
314 /// <param name="permissionID">权限代码</param>
315 /// <param name="revokeOrganizeIDs">撤消的组织代码数组</param>
316 /// <returns>影响的行数</returns>
317 int RevokeUserOrganizeScope(BaseUserInfo userInfo, String userID, String permissionID, String[] revokeOrganizeIDs);
318
319 /// <summary>
320 /// 30.获取用户的某个权限域的角色范围
321 /// </summary>
322 /// <param name="userInfo">用户</param>
323 /// <param name="userID">用户代码</param>
324 /// <param name="permissionID">权限代码</param>
325 /// <returns>代码数组</returns>
326 String[] GetUserScopeRoleIDs(BaseUserInfo userInfo, String userID, String permissionID);
327
328 /// <summary>
329 /// 31.设置用户的某个权限域的角色范围
330 /// </summary>
331 /// <param name="userInfo">用户</param>
332 /// <param name="userID">用户代码</param>
333 /// <param name="permissionID">权限代码</param>
334 /// <param name="grantRoleIDs">授予的角色代码数组</param>
335 /// <returns>影响的行数</returns>
336 int GrantUserRoleScope(BaseUserInfo userInfo, String userID, String permissionID, String[] grantRoleIDs);
337
338 /// <summary>
339 /// 32.设置用户的某个权限域的角色范围
340 /// </summary>
341 /// <param name="userInfo">用户</param>
342 /// <param name="userID">用户代码</param>
343 /// <param name="permissionID">权限代码</param>
344 /// <param name="revokeRoleIDs">撤消的角色代码数组</param>
345 /// <returns>影响的行数</returns>
346 int RevokeUserRoleScope(BaseUserInfo userInfo, String userID, String permissionID, String[] revokeRoleIDs);
347
348 /// <summary>
349 /// 33.获取用户的某个权限域的用户范围
350 /// </summary>
351 /// <param name="userInfo">用户</param>
352 /// <param name="userID">用户代码</param>
353 /// <param name="permissionID">权限代码</param>
354 /// <returns>代码数组</returns>
355 String[] GetUserScopeUserIDs(BaseUserInfo userInfo, String userID, String permissionID);
356
357 /// <summary>
358 /// 34.设置用户的某个权限域的用户范围
359 /// </summary>
360 /// <param name="userInfo">用户</param>
361 /// <param name="userID">用户代码</param>
362 /// <param name="permissionID">权限代码</param>
363 /// <param name="grantUserIDs">授予的用户代码数组</param>
364 /// <returns>影响的行数</returns>
365 int GrantUserUserScope(BaseUserInfo userInfo, String userID, String permissionID, String[] grantUserIDs);
366
367 /// <summary>
368 /// 35.设置用户的某个权限域的用户范围
369 /// </summary>
370 /// <param name="userInfo">用户</param>
371 /// <param name="userID">用户代码</param>
372 /// <param name="permissionID">权限代码</param>
373 /// <param name="revokeUserIDs">撤消的用户代码数组</param>
374 /// <returns>影响的行数</returns>
375 int RevokeUserUserScope(BaseUserInfo userInfo, String userID, String permissionID, String[] revokeUserIDs);
376
377 /// <summary>
378 /// 36.获取用户授权权限列表
379 /// </summary>
380 /// <param name="userInfo">用户</param>
381 /// <param name="userID">用户代码</param>
382 /// <returns>代码数组</returns>
383 String[] GetUserLicensePermissionIDs(BaseUserInfo userInfo, String userID);
384
385 /// <summary>
386 /// 37.授予用户的授权权限范围
387 /// </summary>
388 /// <param name="userInfo">用户</param>
389 /// <param name="userID">用户代码</param>
390 /// <param name="grantPermissionIDs">授予的权限代码数组</param>
391 /// <returns>影响的行数</returns>
392 int GrantUserLicensePermission(BaseUserInfo userInfo, String userID, String[] grantPermissionIDs);
393
394 /// <summary>
395 /// 38.撤消用户的授权权限范围
396 /// </summary>
397 /// <param name="userInfo">用户</param>
398 /// <param name="userID">用户代码</param>
399 /// <param name="revokePermissionIDs">撤消的权限代码数组</param>
400 /// <returns>影响的行数</returns>
401 int RevokeUserLicensePermission(BaseUserInfo userInfo, String userID, String[] revokePermissionIDs);
402
403
404 //
405 /// 用户模块关联关系相关
406 //
407
408 /// <summary>
409 /// 39.获得用户有权限的模块
410 /// </summary>
411 /// <param name="userInfo">用户</param>
412 /// <param name="userID">用户代码</param>
413 /// <returns>数据表</returns>
414 DataTable GetModuleList(BaseUserInfo userInfo, String userID);
415
416 /// <summary>
417 /// 40.获得用户有权限的模块
418 /// </summary>
419 /// <param name="userInfo">用户</param>
420 /// <param name="userID">用户代码</param>
421 /// <returns>数据表</returns>
422 DataTable GetModuleListByUser(BaseUserInfo userInfo, String userID);
423
424 /// <summary>
425 /// 41.获取用户模块权限范围代码数组
426 /// </summary>
427 /// <param name="userInfo">用户</param>
428 /// <param name="userID">用户代码</param>
429 /// <param name="permissionCode">权限编号</param>
430 /// <returns>代码数组</returns>
431 String[] GetUserScopeModuleIDs(BaseUserInfo userInfo, String userID, String permissionCode);
432
433 /// <summary>
434 /// 42.授予用户模块的权限范围
435 /// </summary>
436 /// <param name="userInfo">用户</param>
437 /// <param name="userID">用户代码</param>
438 /// <param name="grantModuleIDs">授予模块代码数组</param>
439 /// <returns>影响的行数</returns>
440 int GrantUserModuleScope(BaseUserInfo userInfo, String userID, String[] grantModuleIDs);
441
442 /// <summary>
443 /// 43.撤消用户模块的权限范围
444 /// </summary>
445 /// <param name="userInfo">用户</param>
446 /// <param name="userID">用户代码</param>
447 /// <param name="revokeModuleIDs">撤消模块代码数组</param>
448 /// <returns>影响的行数</returns>
449 int RevokeUserModuleScope(BaseUserInfo userInfo, String userID, String[] revokeModuleIDs);
450
451
452 //
453 /// 角色模块关联关系相关
454 //
455
456
457 /// <summary>
458 /// 44.获取用户模块权限范围代码数组
459 /// </summary>
460 /// <param name="userInfo">用户</param>
461 /// <param name="roleID">角色代码</param>
462 /// <param name="permissionCode">权限编号</param>
463 /// <returns>代码数组</returns>
464 String[] GetRoleScopeModuleIDs(BaseUserInfo userInfo, String roleID, String permissionCode);
465
466 /// <summary>
467 /// 45.授予用户模块的权限范围
468 /// </summary>
469 /// <param name="userInfo">用户</param>
470 /// <param name="roleID">角色代码</param>
471 /// <param name="grantModuleIDs">授予模块代码数组</param>
472 /// <returns>影响的行数</returns>
473 int GrantRoleModuleScope(BaseUserInfo userInfo, String roleID, String[] grantModuleIDs);
474
475 /// <summary>
476 /// 46.撤消用户模块的权限范围
477 /// </summary>
478 /// <param name="userInfo">用户</param>
479 /// <param name="roleID">角色代码</param>
480 /// <param name="revokeModuleIDs">撤消模块代码数组</param>
481 /// <returns>影响的行数</returns>
482 int RevokeRoleModuleScope(BaseUserInfo userInfo, String roleID, String[] revokeModuleIDs);
483
484
485 //
486 /// 资源权限设定关系相关
487 //
488
489 /// <summary>
490 /// 47.获取资源权限代码数组
491 /// </summary>
492 /// <param name="userInfo">用户</param>
493 /// <param name="resourceCategory">资源分类</param>
494 /// <returns>代码数组</returns>
495 String[] GetResourcePermissionIDs(BaseUserInfo userInfo, String resourceCategory, String resourceID);
496
497 /// <summary>
498 /// 48.授予资源的权限
499 /// </summary>
500 /// <param name="userInfo">用户</param>
501 /// <param name="resourceCategory">资源分类</param>
502 /// <param name="resourceID">资源代码</param>
503 /// <param name="grantPermissionIDs">权限代码</param>
504 /// <returns>影响的行数</returns>
505 int GrantResourceTargetScope(BaseUserInfo userInfo, String resourceCategory, String resourceID, String grantPermissionIDs);
506
507 /// <summary>
508 /// 49.撤消资源的权限
509 /// </summary>
510 /// <param name="userInfo">用户</param>
511 /// <param name="resourceCategory">资源分类</param>
512 /// <param name="resourceID">资源代码</param>
513 /// <param name="revokePermissionIDs">权限代码</param>
514 /// <returns>影响的行数</returns>
515 int RevokeResourceTargetScope(BaseUserInfo userInfo, String resourceCategory, String resourceID, String revokePermissionIDs);
516
517
518 //
519 /// 资源权限范围设定关系相关
520 //
521
522
523 /// <summary>
524 /// 50.获取资源权限范围代码数组
525 /// </summary>
526 /// <param name="userInfo">用户</param>
527 /// <param name="resourceCategory">资源分类</param>
528 /// <param name="resourceID">资源代码</param>
529 /// <param name="targetCategory">目标类别</param>
530 /// <param name="permissionCode">权限编号</param>
531 /// <returns>代码数组</returns>
532 String[] GetResourceScopeTargetIDs(BaseUserInfo userInfo, String resourceCategory, String resourceID, String targetCategory, String permissionCode);
533
534 /// <summary>
535 /// 51.授予资源的权限范围
536 /// </summary>
537 /// <param name="userInfo">用户</param>
538 /// <param name="resourceCategory">资源分类</param>
539 /// <param name="resourceID">资源代码</param>
540 /// <param name="targetCategory">目标类别</param>
541 /// <param name="grantTargetIDs">目标代码数组</param>
542 /// <param name="permissionID">权限代码</param>
543 /// <returns>影响的行数</returns>
544 int GrantResourceTargetScope(BaseUserInfo userInfo, String resourceCategory, String resourceID, String targetCategory, String[] grantTargetIDs, String permissionID);
545
546 /// <summary>
547 /// 52.撤消资源的权限范围
548 /// </summary>
549 /// <param name="userInfo">用户</param>
550 /// <param name="resourceCategory">资源分类</param>
551 /// <param name="resourceID">资源代码</param>
552 /// <param name="targetCategory">目标类别</param>
553 /// <param name="revokeTargetIDs">目标代码数组</param>
554 /// <param name="permissionID">权限代码</param>
555 /// <returns>影响的行数</returns>
556 int RevokeResourceTargetScope(BaseUserInfo userInfo, String resourceCategory, String resourceID, String targetCategory, String[] revokeTargetIDs, String permissionID);
557 }
558 }