Security ContentAccess.GetAccessibleWhere Example

The query returns only items for which the current user has at least access type level ViewItem. This example is basically the same as this one, only using a less specific viper.

A join is made using the alias 'c' that was given to vwcontent. This alias is passed as the first parameter of the GetAccessibleWhereClause viper.

Smartsite SXML CopyCode image Copy Code
<se:sqlquery 
    sql="select nr,title from vwcontent c where parent=24658 and {security.contentaccess.getaccessiblewhere('c', 'ViewItem')}">
    <se:parameters>
        <se:parameter name="rowformat">{this.field(title)}</se:parameter>
        <se:parameter name="rowdelimiter"><br />
        </se:parameter>
    </se:parameters>
</se:sqlquery>
Example Result CopyCode image Copy Code
Example item 1<br />
        Example item 3<br />
        Example item 4