Skip to content

Commit

Permalink
#192 "Ignore ACL" setting was ignored on catalog pages (when disabled…
Browse files Browse the repository at this point in the history
…). It also increases performance
  • Loading branch information
AndreiMaz committed Jun 28, 2016
1 parent 9ee2020 commit cf80bbc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Libraries/Nop.Services/Catalog/ProductService.cs
Expand Up @@ -653,7 +653,7 @@ public virtual int GetNumberOfProductsInCategory(IList<int> categoryIds = null,

var pAllowedCustomerRoleIds = _dataProvider.GetParameter();
pAllowedCustomerRoleIds.ParameterName = "AllowedCustomerRoleIds";
pAllowedCustomerRoleIds.Value = commaSeparatedAllowedCustomerRoleIds;
pAllowedCustomerRoleIds.Value = !_catalogSettings.IgnoreAcl ? commaSeparatedAllowedCustomerRoleIds : "";
pAllowedCustomerRoleIds.DbType = DbType.String;

var pPageIndex = _dataProvider.GetParameter();
Expand Down
Expand Up @@ -345,6 +345,8 @@ BEGIN
)
INSERT INTO #FilteredCustomerRoleIds (CustomerRoleId)
SELECT CAST(data as int) FROM [nop_splitstring_to_table](@AllowedCustomerRoleIds, ',')
DECLARE @FilteredCustomerRoleIdsCount int
SET @FilteredCustomerRoleIdsCount = (SELECT COUNT(1) FROM #FilteredCustomerRoleIds)

--paging
DECLARE @PageLowerBound int
Expand Down Expand Up @@ -551,7 +553,7 @@ BEGIN
END

--show hidden and ACL
IF @ShowHidden = 0
IF @ShowHidden = 0 and @FilteredCustomerRoleIdsCount > 0
BEGIN
SET @sql = @sql + '
AND (p.SubjectToAcl = 0 OR EXISTS (
Expand Down
5 changes: 3 additions & 2 deletions upgradescripts/3.70-the next version/upgrade.sql
Expand Up @@ -3012,6 +3012,8 @@ BEGIN
)
INSERT INTO #FilteredCustomerRoleIds (CustomerRoleId)
SELECT CAST(data as int) FROM [nop_splitstring_to_table](@AllowedCustomerRoleIds, ',')
DECLARE @FilteredCustomerRoleIdsCount int
SET @FilteredCustomerRoleIdsCount = (SELECT COUNT(1) FROM #FilteredCustomerRoleIds)

--paging
DECLARE @PageLowerBound int
Expand Down Expand Up @@ -3218,7 +3220,7 @@ BEGIN
END

--show hidden and ACL
IF @ShowHidden = 0
IF @ShowHidden = 0 and @FilteredCustomerRoleIdsCount > 0
BEGIN
SET @sql = @sql + '
AND (p.SubjectToAcl = 0 OR EXISTS (
Expand Down Expand Up @@ -3385,7 +3387,6 @@ BEGIN
DROP TABLE #PageIndex
END
GO
GO

--update message templates
UPDATE [MessageTemplate] SET [Body] = REPLACE([Body], 'ReturnRequest.ID', 'ReturnRequest.CustomNumber')
Expand Down

0 comments on commit cf80bbc

Please sign in to comment.