271 lines
12 KiB
C#
271 lines
12 KiB
C#
using Mini.Web.WebHelper.Models;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Mini.Web.WebHelper
|
|
{
|
|
/// <summary>
|
|
/// 平台方权限
|
|
/// </summary>
|
|
public sealed class InitRights
|
|
{
|
|
#region 基础信息 以B***开头
|
|
#region 组织框架 B101~B150
|
|
|
|
public const string CONST_员工管理 = "B105";
|
|
public static InnerRight 员工管理 = new InnerRight()
|
|
{
|
|
RightId = CONST_员工管理,
|
|
RightName = "员工管理",
|
|
ToolBars = InitRights.CreateToolBar(CONST_员工管理, InitToolBar.Add, InitToolBar.Edit, InitToolBar.Delete)
|
|
};
|
|
|
|
#endregion 组织框架 B101~B150
|
|
|
|
|
|
|
|
#region 权限体系 B151~B200
|
|
public const string CONST_权限结构管理 = "B151";
|
|
public static InnerRight 权限结构管理 = new InnerRight()
|
|
{
|
|
RightId = CONST_权限结构管理,
|
|
RightName = "权限结构管理",
|
|
ToolBars = InitRights.CreateToolBar(CONST_权限结构管理, InitRights.SetName(InitToolBar.Other3, "新增组"), InitRights.SetName(InitToolBar.Other4, "新增资源"), InitToolBar.Edit, InitToolBar.Details, InitToolBar.Delete, InitRights.SetName(InitToolBar.Other6, "更新权限"))
|
|
};
|
|
public const string CONST_角色管理 = "B152";
|
|
public static InnerRight 角色管理 = new InnerRight()
|
|
{
|
|
RightId = CONST_角色管理,
|
|
RightName = "角色管理",
|
|
ToolBars = InitRights.CreateToolBar(CONST_角色管理, InitToolBar.Add, InitToolBar.Edit, InitToolBar.Details, InitToolBar.Delete, InitRights.SetName(InitToolBar.Other1, "更新顺序"), InitRights.SetName(InitToolBar.Other2, "绑定企微部门"))
|
|
};
|
|
|
|
public const string CONST_角色权限管理 = "B153";
|
|
public static InnerRight 角色权限管理 = new InnerRight()
|
|
{
|
|
RightId = CONST_角色权限管理,
|
|
RightName = "角色权限管理",
|
|
ToolBars = InitRights.CreateToolBar(CONST_角色权限管理, InitRights.SetName(InitToolBar.Other1, "保存"), InitRights.SetName(InitToolBar.Other2, "新增角色"))
|
|
};
|
|
public const string CONST_员工角色管理 = "B154";
|
|
public static InnerRight 员工角色管理 = new InnerRight()
|
|
{
|
|
RightId = CONST_员工角色管理,
|
|
RightName = "员工角色管理",
|
|
ToolBars = InitRights.CreateToolBar(CONST_员工角色管理, InitRights.SetName(InitToolBar.Other1, "分配角色"))
|
|
};
|
|
|
|
public const string CONST_登陆权限 = "B099";
|
|
public static InnerRight 登陆权限 = new InnerRight()
|
|
{
|
|
RightId = CONST_登陆权限,
|
|
RightName = "登陆权限",
|
|
ToolBars = InitRights.CreateToolBar(CONST_登陆权限)
|
|
};
|
|
|
|
|
|
#endregion 权限体系
|
|
|
|
|
|
|
|
|
|
#region 系统设置 B201~B250
|
|
public const string CONST_菜单管理 = "B201";
|
|
public static InnerRight 菜单管理 = new InnerRight()
|
|
{
|
|
RightId = CONST_菜单管理,
|
|
RightName = "菜单管理",
|
|
ToolBars = InitRights.CreateToolBar(CONST_菜单管理, InitRights.SetName(InitToolBar.Other3, "向上"), InitRights.SetName(InitToolBar.Other4, "向下"), InitRights.SetName(InitToolBar.Other1, "新增模块菜单"), InitRights.SetName(InitToolBar.Other2, "新增系统菜单"), InitToolBar.Edit, InitToolBar.Delete)
|
|
};
|
|
|
|
public const string CONST_清除缓存 = "B206";
|
|
public static InnerRight 清除缓存 = new InnerRight()
|
|
{
|
|
RightId = CONST_清除缓存,
|
|
RightName = "清除缓存",
|
|
ToolBars = InitRights.CreateToolBar(CONST_清除缓存, InitRights.SetName(InitToolBar.Other1, "清除缓存"), InitRights.SetName(InitToolBar.Other2, "刷新"))
|
|
};
|
|
//public const string CONST_参数配置 = "B203";
|
|
//public static InnerRight 参数配置 = new InnerRight()
|
|
//{
|
|
// RightId = CONST_参数配置,
|
|
// RightName = "参数配置",
|
|
// ToolBars = InitRights.CreateToolBar(CONST_参数配置, InitToolBar.Add, InitToolBar.Edit, InitToolBar.Details, InitToolBar.Delete)
|
|
//};
|
|
//public const string CONST_参数分组配置 = "B204";
|
|
//public static InnerRight 参数分组配置 = new InnerRight()
|
|
//{
|
|
// RightId = CONST_参数分组配置,
|
|
// RightName = "参数分组配置",
|
|
// ToolBars = InitRights.CreateToolBar(CONST_参数分组配置, InitToolBar.Add, InitToolBar.Edit, InitToolBar.Details, InitToolBar.Delete)
|
|
//};
|
|
#endregion
|
|
|
|
|
|
|
|
#endregion 基础信息 以B***开头
|
|
|
|
#region 公用权限 以P***开头
|
|
public const string CONST_公共权限 = "P101";
|
|
public static InnerRight 公共权限 = new InnerRight()
|
|
{
|
|
RightId = CONST_公共权限,
|
|
RightName = "公共权限",
|
|
ToolBars = InitRights.CreateToolBar(CONST_公共权限)
|
|
};
|
|
#endregion
|
|
|
|
public const string CONST_企业微信监控 = "R132";
|
|
public static InnerRight 企业微信监控 = new InnerRight()
|
|
{
|
|
RightId = CONST_企业微信监控,
|
|
RightName = "企业微信监控",
|
|
ToolBars = InitRights.CreateToolBar(CONST_企业微信监控, InitRights.SetName(InitToolBar.Other1, "聊天记录"), InitRights.SetName(InitToolBar.Other2, "外部联系人"), InitRights.SetName(InitToolBar.Other3, "查找客户"), InitRights.SetName(InitToolBar.Other4, "群管理"), InitRights.SetName(InitToolBar.Other5, "备注姓名"))
|
|
};
|
|
|
|
public const string CONST_企业微信导出聊天记录 = "R135";
|
|
public static InnerRight 企业微信导出聊天记录 = new InnerRight()
|
|
{
|
|
RightId = CONST_企业微信导出聊天记录,
|
|
RightName = "企业微信导出聊天记录",
|
|
ToolBars = InitRights.CreateToolBar(CONST_企业微信导出聊天记录)
|
|
};
|
|
|
|
public const string CONST_企业微信关键词合规 = "R136";
|
|
public static InnerRight 企业微信关键词合规 = new InnerRight()
|
|
{
|
|
RightId = CONST_企业微信关键词合规,
|
|
RightName = "企业微信关键词合规",
|
|
ToolBars = InitRights.CreateToolBar(CONST_企业微信关键词合规)
|
|
};
|
|
|
|
public const string CONST_群管理 = "R133";
|
|
public static InnerRight 群管理 = new InnerRight()
|
|
{
|
|
RightId = CONST_群管理,
|
|
RightName = "群管理",
|
|
ToolBars = InitRights.CreateToolBar(CONST_群管理, InitRights.SetName(InitToolBar.Other1, "设置群名称"), InitRights.SetName(InitToolBar.Other2, "聊天记录"))
|
|
};
|
|
|
|
public const string CONST_企微通话查询 = "R134";
|
|
public static InnerRight 企微通话查询 = new InnerRight()
|
|
{
|
|
RightId = CONST_企微通话查询,
|
|
RightName = "企微通话查询",
|
|
ToolBars = InitRights.CreateToolBar(CONST_企微通话查询)
|
|
};
|
|
public const string CONST_微信监控 = "R137";
|
|
public static InnerRight 微信监控 = new InnerRight()
|
|
{
|
|
RightId = CONST_微信监控,
|
|
RightName = "微信监控",
|
|
ToolBars = InitRights.CreateToolBar(CONST_微信监控, InitRights.SetName(InitToolBar.Other1, "聊天记录"), InitRights.SetName(InitToolBar.Other2, "微信好友"), InitRights.SetName(InitToolBar.Other3, "微信红包"))
|
|
};
|
|
|
|
public const string CONST_内部群 = "R138";
|
|
public static InnerRight 内部群 = new InnerRight()
|
|
{
|
|
RightId = CONST_内部群,
|
|
RightName = "内部群",
|
|
ToolBars = InitRights.CreateToolBar(CONST_内部群, InitRights.SetName(InitToolBar.Other1, "聊天记录"))
|
|
};
|
|
|
|
public const string CONST_外部群 = "R139";
|
|
public static InnerRight 外部群 = new InnerRight()
|
|
{
|
|
RightId = CONST_外部群,
|
|
RightName = "外部群",
|
|
ToolBars = InitRights.CreateToolBar(CONST_外部群, InitRights.SetName(InitToolBar.Other1, "聊天记录"))
|
|
};
|
|
|
|
public const string CONST_我的企微员工管理 = "R140";
|
|
public static InnerRight 我的企微员工管理 = new InnerRight()
|
|
{
|
|
RightId = CONST_我的企微员工管理,
|
|
RightName = "我的企微员工管理",
|
|
ToolBars = InitRights.CreateToolBar(CONST_我的企微员工管理, InitRights.SetName(InitToolBar.Other1, "聊天记录"), InitRights.SetName(InitToolBar.Other2, "外部联系人"), InitRights.SetName(InitToolBar.Other3, "设置工号"))
|
|
};
|
|
|
|
public const string CONST_我的企业微信监控 = "R141";
|
|
public static InnerRight 我的企业微信监控 = new InnerRight()
|
|
{
|
|
RightId = CONST_我的企业微信监控,
|
|
RightName = "我的企业微信监控",
|
|
ToolBars = InitRights.CreateToolBar(CONST_我的企业微信监控, InitRights.SetName(InitToolBar.Other1, "聊天记录"), InitRights.SetName(InitToolBar.Other2, "外部联系人"))
|
|
};
|
|
public const string CONST_朋友圈 = "R142";
|
|
public static InnerRight 朋友圈 = new InnerRight()
|
|
{
|
|
RightId = CONST_朋友圈,
|
|
RightName = "朋友圈",
|
|
ToolBars = InitRights.CreateToolBar(CONST_朋友圈, InitRights.SetName(InitToolBar.Other1, "详细内容"))
|
|
};
|
|
public static List<InnerRight> getInitRights()
|
|
{
|
|
List<InnerRight> initRights = new List<InnerRight>();
|
|
#region 基础信息
|
|
#region 组织框架
|
|
initRights.Add(员工管理);
|
|
initRights.Add(登陆权限);
|
|
#endregion 组织框架
|
|
|
|
|
|
#region 权限体系
|
|
initRights.Add(权限结构管理);
|
|
initRights.Add(角色管理);
|
|
initRights.Add(角色权限管理);
|
|
initRights.Add(员工角色管理);
|
|
#endregion 权限体系
|
|
|
|
#region 系统设置
|
|
initRights.Add(菜单管理);
|
|
initRights.Add(清除缓存);
|
|
//initRights.Add(参数配置);
|
|
//initRights.Add(参数分组配置);
|
|
#endregion 系统设置
|
|
initRights.Add(企业微信导出聊天记录);
|
|
initRights.Add(企业微信关键词合规);
|
|
initRights.Add(企业微信监控);
|
|
initRights.Add(群管理);
|
|
initRights.Add(企微通话查询);
|
|
initRights.Add(微信监控);
|
|
initRights.Add(内部群);
|
|
initRights.Add(外部群);
|
|
initRights.Add(我的企微员工管理);
|
|
initRights.Add(我的企业微信监控);
|
|
initRights.Add(朋友圈);
|
|
#endregion 基础信息
|
|
|
|
#region 公共权限
|
|
initRights.Add(公共权限);
|
|
#endregion
|
|
|
|
return initRights;
|
|
}
|
|
public static List<ToolBarBtn> CreateToolBar(string rightId, params object[] toolbars)
|
|
{
|
|
List<ToolBarBtn> list = new List<ToolBarBtn>();
|
|
foreach (ToolBarBtn ob in toolbars)
|
|
{
|
|
ToolBarBtn tb = new ToolBarBtn();
|
|
tb.RightId = rightId;
|
|
tb.ToolBarId = ob.ToolBarId;
|
|
tb.ToolBarCode = ob.ToolBarCode;
|
|
tb.ToolBarName = ob.ToolBarName;
|
|
list.Add(tb);
|
|
}
|
|
return list;
|
|
}
|
|
public static ToolBarBtn SetName(ToolBarBtn tbar, string name)
|
|
{
|
|
tbar.ToolBarName = name;
|
|
return tbar;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|