示例#1
0
        public static bool checkCreateRight(Guid userID, string tableName)
        {
            if (isAdmin(userID))
            {
                return(true);
            }
            var customRightBaseDic = getTableRight(userID);

            if (customRightBaseDic == null)
            {
                return(false);
            }
            var RightBaseDic = new SysUserTableRight(userID, tableName, PermissionTypeEnum.Create);

            if (customRightBaseDic.ContainsKey(RightBaseDic.getKey()))
            {
                return(true);
            }
            return(false);
        }
示例#2
0
        private static string getWhereSql(Guid userID, string tableName, PermissionTypeEnum permissionType)
        {
            if (isAdmin(userID))
            {
                return(AllWhere);
            }
            var tableRightDic = getTableRight(userID);

            if (tableRightDic == null)
            {
                return(NoneWhere);
            }
            var rightDic = new SysUserTableRight(userID, tableName, permissionType);

            if (tableRightDic.TryGetValue(rightDic.getKey(), out rightDic))
            {
                return(rightDic.getWhereSql());
            }
            return(NoneWhere);
        }