12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- using System.Data;
- using CoreEntity.Entity;
- using System.Data.SqlClient;
- using ZcPeng.PublicLibrary;
- using Common.Model;
- using Newtonsoft.Json.Converters;
- using Newtonsoft.Json;
- using Common.Wechat;
- using CoreEntity.DAL;
- namespace SupplierWeb.Codes.Auth
- {
- public class PermissionHelper
- {
- public static Dictionary<string,Permission> Permissions(int roleId,string filter = " and A.AuthType ='O'")
- {
- #region 获取角色的权限
- IList<Permission> perms = (List<Permission>)RoleDAL.GetPermissions(roleId, filter);
- #endregion
- Dictionary<string, Permission> permsd = new Dictionary<string, Permission>(perms.Count);
- foreach (Permission perm in perms)
- {
- if (perm.PermissionUrl!=null&&!permsd.ContainsKey(perm.PermissionUrl)) {
- perm.Roleids = null;
- permsd.Add(perm.PermissionUrl,perm);
- }
- }
- //IsoDateTimeConverter timejson = new IsoDateTimeConverter
- //{
- // DateTimeFormat = "yyyy'-'MM'-'dd' 'HH':'mm':'ss"
- //};
- //var jsonData = JsonConvert.SerializeObject(users, timejson);
- return permsd;
- }
- }
- }
|