31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
using Core.Web.WebHelper.UtilityModel;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace Core.Web.WebHelper
|
|
{
|
|
public class ToolButtonView
|
|
{
|
|
public string[] ToolButtonRight(InnerRight right, string[] rights)
|
|
{
|
|
List<string> toolbuttons = new List<string>();
|
|
string[] rolesRights = rights.Where(p => p.Contains(right.RightId)).ToArray();
|
|
for (int i = 0; i < rolesRights.Length; i++)
|
|
{
|
|
if (rolesRights[i] != null && (rolesRights[i].Length > 4) && (string.Compare(rolesRights[i], 0, right.RightId, 0, 4, StringComparison.OrdinalIgnoreCase) == 0))
|
|
{
|
|
int toolbar = Convert.ToInt32(rolesRights[i].Substring(4));
|
|
foreach (var model in right.ToolBars)
|
|
{
|
|
//if ((toolbar & model.ToolBarId) > 0)
|
|
//{
|
|
toolbuttons.Add(model.ToolBarCode);//现在全部给
|
|
//}
|
|
}
|
|
}
|
|
}
|
|
return toolbuttons.Distinct().ToArray();
|
|
}
|
|
}
|
|
} |