简体   繁体   中英

check if user has permissions to add items to the list in a SharePoint DVWP with XSLT

Is it possible to check if a user has permissions to add items to the list in a DVWP when rending with XSLT?

The idea being to see if the user has access to add and if they do add a link to the newform page.

You can do it by this XSLT function ddwrt:IfHasRights(XX) where XX is permission mask. Like this:

<xsl:if test="ddwrt:IfHasRights(16)"><tr>
<td width="190px" valign="top" class="ms-formlabel"><H3 class="ms-standardheader"><nobr>Entry Status</nobr></H3></td>
<td width="400px" valign="top" class="ms-formbody"><SharePoint:FormField runat="server" id="ff8{$Pos}" ControlMode="New" FieldName="Entry_x0020_Status" __designer:bind="{ddwrt:DataBind('i',concat('ff8',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Entry_x0020_Status')}" /><SharePoint:FieldDescription runat="server" id="ff8description{$Pos}" FieldName="Entry_x0020_Status" ControlMode="New" /></td>
</tr>
</xsl:if>

More detailed description can you find eg here . But be aware that it works fine for SP2010, SP2013 but not in SP Online.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM