通用权限管理实现标准82个接口参考【附源码】
2008-11-27 13:07 通用C#系统架构 阅读(5156) 评论(7) 编辑 收藏 举报说明:
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);
}
}
将权限管理、工作流管理做到我能力的极致,一个人只能做好那么很少的几件事情。