原来计划在RBAC的角色对应资源的权限字段,进行控制,使用Enum枚举类型!
但是考虑到通用性,模块封装成dll之后,不便修改!所以使用了class来替代Enum
这样以后有特别需要的人,可以继承该类并添加字段.
代码原型如下:
namespace Sov.RBAC
{
/// <summary>
/// 权限操作说明类
/// </summary>
public class Operate
{
/// <summary>
/// 禁止,其它权限都无效
/// </summary>
public static readonly Operate Disable = new Operate(-1);
/// <summary>
/// 访问
/// </summary>
public static readonly Operate Access = new Operate(1);
/// <summary>
/// 添加
/// </summary>
public static readonly Operate Add = new Operate(2);
/// <summary>
/// 修改
/// </summary>
public static readonly Operate Edit = new Operate(4);
/// <summary>
/// 删除
/// </summary>
public static readonly Operate Delete = new Operate(8);
/// <summary>
/// 查询
/// </summary>
public static readonly Operate Search = new Operate(16);
/// <summary>
/// 打印
/// </summary>
public static readonly Operate Print = n |