ButtonAuthority / AuthorityCategory 权限值定义|C/S开发框架
作者:csframework|C/S框架网  发布日期:2023/08/03 12:43:46

ButtonAuthority 类

C# 全选
 /// <summary>    
    ///定义功能按钮的权限值,权限值:2^n次方(n>0),系统数据库tb_MyActions表定义权限值
    ///开发框架提供26个功能按钮权限值,每个表单最多可控制26个按钮权限。
    ///32位的PC机,所有权限值相加必须<=Int32的最大值<=2147483647
    /// </summary>
    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 SHOW_MOD_HISTORY = 4096;

        /// <summary>
        /// 14-预留权限1
        /// </summary>
        public const int RESERVED1 = 8192;

        /// <summary>
        /// 15-预留权限2
        /// </summary>
        public const int RESERVED2 = 16384;

        /// <summary>
        /// 16-预留权限3
        /// </summary>
        public const int RESERVED3 = 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;

    }

AuthorityCategory 类

C# 全选
    /// <summary>
    /// 数据窗体的权限值组合,多个按钮权限值相加。
    /// 窗体指定权限。
    /// </summary>
    public class AuthorityCategory
    {
        /// <summary>
        /// 无权限
        /// </summary>
        public const int NONE = 0;

        /// <summary>
        /// 数据操作窗体:拥有的基本权限(增、删、改、查、导出文件)
        /// </summary>
        public const int DATA_ACTION_VALUE = ButtonAuthority.ADD + ButtonAuthority.EDIT + ButtonAuthority.DELETE + ButtonAuthority.VIEW + ButtonAuthority.EXPORT;

        /// <summary>
        /// 报表窗体:拥有的功能(打印、预览)
        /// </summary>
        public const int REPORT_ACTION_VALUE = ButtonAuthority.PREVIEW + ButtonAuthority.PRINT;

        /// <summary>
        /// 业务单据窗体:拥有的功能(增、删、改、查、打印、预览、审核、修改历史记录查询)
        /// </summary>
        public const int BUSINESS_ACTION_VALUE = DATA_ACTION_VALUE + REPORT_ACTION_VALUE +
            ButtonAuthority.APPROVAL +
            ButtonAuthority.SHOW_MOD_HISTORY;

        /// <summary>
        /// 数据字典窗体:拥有的功能(增、删、改、查、导出、打印、预览)
        /// </summary>
        public const int MASTER_ACTION = DATA_ACTION_VALUE + REPORT_ACTION_VALUE;

        /// <summary>
        /// 所有功能权限(对应ButtonAuthority类所有成员的值相加)        
        /// </summary>
        public const int ALL_ACTION_VALUE =
            ButtonAuthority.ADD +
            ButtonAuthority.EDIT +
            ButtonAuthority.DELETE +
            ButtonAuthority.VIEW +
            ButtonAuthority.EXPORT +
            ButtonAuthority.PREVIEW +
            ButtonAuthority.PRINT +
            ButtonAuthority.APPROVAL +
            ButtonAuthority.SHOW_MOD_HISTORY +
            ButtonAuthority.CLONE +
            ButtonAuthority.GENERATE +
            ButtonAuthority.LOCK +
            ButtonAuthority.VOID +
            ButtonAuthority.RESERVED1 +
            ButtonAuthority.RESERVED2 +
            ButtonAuthority.RESERVED3 +
            ButtonAuthority.EX_01 +
            ButtonAuthority.EX_02 +
            ButtonAuthority.EX_03 +
            ButtonAuthority.EX_04 +
            ButtonAuthority.EX_05 +
            ButtonAuthority.EX_06 +
            ButtonAuthority.EX_07 +
            ButtonAuthority.EX_08 +
            ButtonAuthority.EX_09 +
            ButtonAuthority.EX_10;
    }

C/S框架网|原创精神.创造价值.打造精品


扫一扫加作者微信
C/S框架网作者微信 C/S框架网|原创作品.质量保障.竭诚为您服务
上一篇 下一篇