on 2019 May 23 10:48 AM
When I execute the below query in HAC(admin user), I am getting the expected results but the same query is used in search restriction in backoffice for vendor user role, it is showing all the products.
Select count(distinct {p.pk}) from {Vendor as v JOIN VendorUnavailableProducts as vup ON {vup.vendor} = {v.pk} JOIN Vendor2UnavailProducts as v2up ON {v2up.source} = {vup.pk} JOIN product as p ON {v2up.target} = {p.pk} JOIN CatalogVersion as cv ON {cv.pk} = {p.catalogversion} JOIN Catalog as c ON {c.pk} = {cv.catalog} } where {v.code} ='1679' and {c.id} = 'myProductCatalog'
Did I miss something in the below search restriction? INSERT_UPDATE SearchRestriction;code[unique=true];name[lang=en];restrictedType(code);principal(uid);active;generate;query ;tr_icecreamvendoradmin_product_restricted;;Product;icecreamvendoradmingroup;true;true;{pk} in ({{Select distinct {p.pk} from {Vendor as v JOIN VendorUnavailableProducts as vup ON {vup.vendor} = {v.pk} JOIN Vendor2UnavailProducts as v2up ON {v2up.source} = {vup.pk} JOIN product as p ON {v2up.target} = {p.pk} JOIN CatalogVersion as cv ON {cv.pk} = {p.catalogversion} JOIN Catalog as c ON {c.pk} = {cv.catalog} } where {v.code} ='1679' and {c.id} = 'myProductCatalog'}})
Request clarification before answering.
On the application of the restriction, the effective FlexibleSearch statement will be as follows:
SELECT {pk} FROM {Product} WHERE {pk} IN ({{SELECT DISTINCT {p.pk} FROM {Vendor AS v JOIN VendorUnavailableProducts AS vup ON {vup.vendor} = {v.pk} JOIN Vendor2UnavailProducts AS v2up ON {v2up.source} = {vup.pk} JOIN Product AS p ON {v2up.target} = {p.pk} JOIN CatalogVersion AS cv ON {cv.pk} = {p.catalogversion} JOIN Catalog AS c ON {c.pk} = {cv.catalog} } WHERE {v.code} ='1679' AND {c.id} = 'myProductCatalog'}})
Please check your query if it is what you want icecreamvendoradmingroup to restrict to.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.