C/S系统开发框架权限系统 - 功能按钮权限值 - ButtonAuthority类详解
C/S系统开发框架权限系统 - 功能按钮权限值 - ButtonAuthority类详解
Winform快速开发框架之权限系统设计(3) - 功能按钮权限控制基本原理
扫一扫加作者微信
ButtonAuthority类详解
ButtonAuthority类定义每个功能按钮的权限值,权限值为2^n次方(n>0) ,如:1,2,4,8,16,32......
开发框架默认提供26个功能按钮(权限按钮)的权限值, 2^26次方。
基于32位的PC机,所有权限值相加必须<=Int32,最大值<=2147483647
C# Code:
public class ButtonAuthority
{
/// <summary>
/// 未定义权限
/// </summary>
public const int NONE = 0;
/// <summary>
/// 1-新增
/// </summary>
public const int ADD = 1;
/// <summary>
/// 2-删除
/// </summary>
public const int DELETE = 2;
/// <summary>
/// 3-修改
/// </summary>
public const int EDIT = 4;
/// <summary>
/// 4-查看
/// </summary>
public const int VIEW = 8;
/// <summary>
/// 5-批准(审核)
/// </summary>
public const int APPROVAL = 16;
/// <summary>
/// 6-打印
/// </summary>
public const int PRINT = 32;
/// <summary>
/// 7-打印预览
/// </summary>
public const int PREVIEW = 64;
/// <summary>
/// 8-作废单据
/// </summary>
public const int VOID = 128;
/// <summary>
/// 9-生成单据
/// </summary>
public const int GENERATE = 256;
/// <summary>
/// 10-复制单据
/// </summary>
public const int CLONE = 512;
/// <summary>
/// 11-导出数据,如:Excel,PDF文件
/// </summary>
public const int EXPORT = 1024;
/// <summary>
/// 12-锁定
/// </summary>
public const int LOCK = 2048;
/// <summary>
/// 13-单据反向操作(如反锁定,反审核)
/// </summary>
public const int UNDO = 4096;
/// <summary>
/// 14-预留权限1
/// </summary>
public const int RESERVED1 = 8192;
/// <summary>
/// 15-预留权限2
/// </summary>
public const int RESERVED2 = 16384;
/// <summary>
/// 16-查看数据修改历史记录
/// </summary>
public const int SHOW_MOD_HISTORY = 32768;
/// <summary>
/// 17-扩展权限EX_01:65536
/// </summary>
public const int EX_01 = 65536;
/// <summary>
/// 18-扩展权限EX_02:131072
/// </summary>
public const int EX_02 = 131072;
/// <summary>
/// 19-扩展权限EX_03:262144
/// </summary>
public const int EX_03 = 262144;
/// <summary>
/// 20-扩展权限EX_04:524288
/// </summary>
public const int EX_04 = 524288;
/// <summary>
/// 21-扩展权限EX_05:1048576
/// </summary>
public const int EX_05 = 1048576;
/// <summary>
/// 22-扩展权限EX_06:2097152
/// </summary>
public const int EX_06 = 2097152;
/// <summary>
/// 23-扩展权限EX_07:4194304
/// </summary>
public const int EX_07 = 4194304;
/// <summary>
/// 24-扩展权限EX_08:8388608
/// </summary>
public const int EX_08 = 8388608;
/// <summary>
/// 25-扩展权限EX_09:16777216
/// </summary>
public const int EX_09 = 16777216;
/// <summary>
/// 26-扩展权限EX_10:33554432
/// </summary>
public const int EX_10 = 33554432;
}
//来源:C/S框架网 | www.csframework.com | QQ:23404761
{
/// <summary>
/// 未定义权限
/// </summary>
public const int NONE = 0;
/// <summary>
/// 1-新增
/// </summary>
public const int ADD = 1;
/// <summary>
/// 2-删除
/// </summary>
public const int DELETE = 2;
/// <summary>
/// 3-修改
/// </summary>
public const int EDIT = 4;
/// <summary>
/// 4-查看
/// </summary>
public const int VIEW = 8;
/// <summary>
/// 5-批准(审核)
/// </summary>
public const int APPROVAL = 16;
/// <summary>
/// 6-打印
/// </summary>
public const int PRINT = 32;
/// <summary>
/// 7-打印预览
/// </summary>
public const int PREVIEW = 64;
/// <summary>
/// 8-作废单据
/// </summary>
public const int VOID = 128;
/// <summary>
/// 9-生成单据
/// </summary>
public const int GENERATE = 256;
/// <summary>
/// 10-复制单据
/// </summary>
public const int CLONE = 512;
/// <summary>
/// 11-导出数据,如:Excel,PDF文件
/// </summary>
public const int EXPORT = 1024;
/// <summary>
/// 12-锁定
/// </summary>
public const int LOCK = 2048;
/// <summary>
/// 13-单据反向操作(如反锁定,反审核)
/// </summary>
public const int UNDO = 4096;
/// <summary>
/// 14-预留权限1
/// </summary>
public const int RESERVED1 = 8192;
/// <summary>
/// 15-预留权限2
/// </summary>
public const int RESERVED2 = 16384;
/// <summary>
/// 16-查看数据修改历史记录
/// </summary>
public const int SHOW_MOD_HISTORY = 32768;
/// <summary>
/// 17-扩展权限EX_01:65536
/// </summary>
public const int EX_01 = 65536;
/// <summary>
/// 18-扩展权限EX_02:131072
/// </summary>
public const int EX_02 = 131072;
/// <summary>
/// 19-扩展权限EX_03:262144
/// </summary>
public const int EX_03 = 262144;
/// <summary>
/// 20-扩展权限EX_04:524288
/// </summary>
public const int EX_04 = 524288;
/// <summary>
/// 21-扩展权限EX_05:1048576
/// </summary>
public const int EX_05 = 1048576;
/// <summary>
/// 22-扩展权限EX_06:2097152
/// </summary>
public const int EX_06 = 2097152;
/// <summary>
/// 23-扩展权限EX_07:4194304
/// </summary>
public const int EX_07 = 4194304;
/// <summary>
/// 24-扩展权限EX_08:8388608
/// </summary>
public const int EX_08 = 8388608;
/// <summary>
/// 25-扩展权限EX_09:16777216
/// </summary>
public const int EX_09 = 16777216;
/// <summary>
/// 26-扩展权限EX_10:33554432
/// </summary>
public const int EX_10 = 33554432;
}
//来源:C/S框架网 | www.csframework.com | QQ:23404761
参考文档:
Winform快速开发框架之权限系统设计(3) - 功能按钮权限控制基本原理
扫一扫加作者微信
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网